rem: var i;  for(i = 0; i < 10; i++) if(this.stacks[i].hasChildNodes() && this.canMoveTo(card,this.stacks[i])) return this.stacks[i];  for(i = 0; i < 10; i++) if(!this.stacks[i].hasChildNodes() && this.canMoveTo(card,this.stacks[i])) return this.stacks[i];  if(card!=card.parentNode.lastChild) return null;  for(i = 0; i < 4; i++) if(this.canMoveTo(card,this.cells[i])) return this.cells[i];  for(i = 0; i < 4; i++) if(this.canMoveTo(card,this.foundations[i])) return this.foundations[i];  return null; 
add: var piles = card.parentNode.isNormalPile ? getPilesRound(card.parentNode) : this.stacks; return searchPiles(piles, testCanMoveToNonEmptyPile(card)) || searchPiles(piles, testCanMoveToEmptyPile(card)) || (!card.nextSibling && ( searchPiles(this.cells, testPileIsEmpty) || searchPiles(this.foundations, testCanMoveToFoundation(card)))); 
context:   getBestMoveForCard: function(card) {    var i;    // move to another stack which has cards on    for(i = 0; i < 10; i++)      if(this.stacks[i].hasChildNodes() && this.canMoveTo(card,this.stacks[i]))        return this.stacks[i];    // move to a space    for(i = 0; i < 10; i++)      if(!this.stacks[i].hasChildNodes() && this.canMoveTo(card,this.stacks[i]))        return this.stacks[i];    // save some needless calculation    if(card!=card.parentNode.lastChild)      return null;    // move to cell    for(i = 0; i < 4; i++)      if(this.canMoveTo(card,this.cells[i]))        return this.cells[i];    // move to foundations    for(i = 0; i < 4; i++)      if(this.canMoveTo(card,this.foundations[i]))        return this.foundations[i];    // failed    return null;  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/16cf1285aa3c691e959e2aabb4cbf0501cad4a97/towers.js/clean/towers.js