rem:  var parent = card.parentNode; var piles = parent.isNormalPile ? this.getPilesRound(parent) : this.stacks; for(var i = 0; i < piles.length; i++) if(this.canMoveToPile(card,piles[i])) return piles[i];  if(card.parentNode.isFoundation) return null; for(var j = 0; j < this.foundations.length; j++) { var pile = this.foundations[j]; if(this.canMoveToFoundation(card, pile)) return pile; } return null; 
add: var piles = card.parentNode.isNormalPile ? getPilesRound(card.parentNode) : this.stacks; return searchPiles(piles, testCanMoveToPile(card)) || (!card.nextSibling && searchPiles(this.foundations, testCanMoveToFoundation(card))); 
context:   getBestMoveForCard: function(card) {    // to a non-foundation    var parent = card.parentNode;    var piles = parent.isNormalPile ? this.getPilesRound(parent) : this.stacks;    for(var i = 0; i < piles.length; i++)      if(this.canMoveToPile(card,piles[i])) return piles[i];    // to a foundation    if(card.parentNode.isFoundation) return null;    for(var j = 0; j < this.foundations.length; j++) {      var pile = this.foundations[j];      if(this.canMoveToFoundation(card, pile)) return pile;    }    return null;  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/16cf1285aa3c691e959e2aabb4cbf0501cad4a97/doublesol.js/buggy/doublesol.js