rem: if(action=="dealt-from-stock") { var score = 0; 
add: if(action.action=="dealt-from-stock") { 
context:   getScoreFor: function(actionObj) {    var action = actionObj.action;    if(action=="dealt-from-stock") {      var score = 0;      // how many empty piles are we going to fill?      for(var j = 0; j < 8; j++)        if(!this.stacks[j].hasChildNodes()) score -= MOD3_EMPTY_TABLEAU;      return score;    }    // it's a MoveAction    var card = actionObj.card, source = actionObj.source;    switch(action) {      case "move-to-foundation":        // will we create an empty space?        // source==card.parentNode for smartMove, but not if the card was dragged.        var emptySpace = (source==card.parentNode ? !card.previousSibling : source.hasChildNodes());        return MOD3_CARD_IN_PLACE + (emptySpace ? MOD3_EMPTY_TABLEAU : 0);      case "move-from-foundation":        // will we be moving the card out of position too?        return -MOD3_EMPTY_TABLEAU - (source.baseCardInPlace() ? MOD3_CARD_IN_PLACE : 0);      case "move-between-piles":        if(source.isFoundation) {          // is the card in place already?          // again, we have to handle both drag+drop and smart move, so |card| might or might          // not still be a child of |source|          if((!source.hasChildNodes() && card.rowNum===0) || source.baseCardInPlace()) return 0;          return MOD3_CARD_IN_PLACE;        }        // have we used up an empty space, or just moved the card from one space to another?        if(source==card.parentNode ? !!card.previousSibling : !source.hasChildNodes()) return 0;        return -MOD3_EMPTY_TABLEAU;    }    // just in case    return 0;  }
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/525a732e3ce3bab72e92a076283a028d1ca596d6/mod3.js/buggy/mod3.js