rem: var piles = card.parentNode.isNormalPile ? this.getPilesRound(card.parentNode) : this.stacks; var i, pile;  for(i = 0; i < piles.length; i++) { pile = piles[i]; if(pile.hasChildNodes() && this.canMoveTo(card, pile)) return pile; }  for(i = 0; i < piles.length; i++) { pile = piles[i]; if(!pile.hasChildNodes() && this.canMoveTo(card, pile)) return pile; }  for(i = 0; i < 8; i++) { pile = this.foundations[i]; if(pile!=card.parentNode && this.canMoveToFoundation(card,pile)) return pile; } return null; 
add: var piles = card.parentNode.isNormalPile ? getPilesRound(card.parentNode) : this.stacks; return searchPiles(piles, testCanMoveToNonEmptyPile(card)) || searchPiles(piles, testPileIsEmpty) || searchPiles(this.foundations, testCanMoveToFoundation(card)); 
context:   getBestMoveForCard: function(card) {    var piles = card.parentNode.isNormalPile ? this.getPilesRound(card.parentNode) : this.stacks;    var i, pile;    // find a move onto another nonempty pile    for(i = 0; i < piles.length; i++) {      pile = piles[i];      if(pile.hasChildNodes() && this.canMoveTo(card, pile)) return pile;    }    // find a move to an empty pile    for(i = 0; i < piles.length; i++) {      pile = piles[i];      if(!pile.hasChildNodes() && this.canMoveTo(card, pile)) return pile;    }    // move to a foundation    for(i = 0; i < 8; i++) {      pile = this.foundations[i];      if(pile!=card.parentNode && this.canMoveToFoundation(card,pile)) return pile;    }    return null;  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/16cf1285aa3c691e959e2aabb4cbf0501cad4a97/gypsy.js/clean/gypsy.js