context:   initStacks: function() {    // We have to set these all to empty arrays now, or every game ends up using the *same* arrays    // for |stacks|, |foundations|, etc., which means everything breaks horribly as soon as a the    // user switches to a new type of game.    this.stacks = [];    this.cells = [];    this.reserves = [];    this.foundations = [];    this.allstacks = [];    var id = this.id;    this.stock = createCardPile(id+"-stock");    if(this.stock) {      this.stock.isStock = true;      this.allstacks.push(this.stock);      // a <label/> for displaying the num. of deals left      this.stock.counter = document.getElementById(id+"-stock-counter");    }    this.waste = createCardPile(id+"-waste");    if(this.waste) {      this.waste.isWaste = true;      this.allstacks.push(this.waste);    }    // try for a single foundation or reserve pile    this.foundation = createCardPile(id+"-foundation");    if(this.foundation) {      this.foundation.isFoundation = true;      this.allstacks.push(this.foundation);    }    this.reserve = createCardPile(id+"-reserve");    if(this.reserve) {      this.reserve.isReserve = true;      this.allstacks.push(this.reserve);    }    // try for >1 piles, foundations, reserves and cells    var i, node;    for(i = 0; true; i++) {      node = createCardPile(id+"-pile-"+i);      if(!node) break;      node.isNormalPile = true;      this.stacks.push(node);      this.allstacks.push(node);    }    for(i = 0; true; i++) {      node = createCardPile(id+"-foundation-"+i);      if(!node) break;      node.isFoundation = true;      this.foundations.push(node);      this.allstacks.push(node);    }    for(i = 0; true; i++) {      node = createCardPile(id+"-reserve-"+i);      if(!node) break;      node.isReserve = true;      this.reserves.push(node);      this.allstacks.push(node);    }    for(i = 0; true; i++) {      node = createCardPile(id+"-cell-"+i);      if(!node) break;      node.isCell = true;      this.cells.push(node);      this.allstacks.push(node);    }    // drag'n'drop targets.  could also include cells, but FreeCell/Towers don't use d'n'd in any case    this.dragDropTargets = this.stacks.concat(this.foundations);    if(this.foundation) this.dragDropTargets.push(this.foundation);    // which piles should we automatically reveal the top card of?    // (some games have no use for this, but checking all these piles doesn't take very long so...)    this.thingsToReveal = this.stacks.concat(this.reserves);    if(this.reserve) this.thingsToReveal.push(this.reserve);  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/0cba6dcc760eeefa28646ee9b3c9f46eaff0a7de/cardgame.js/buggy/cardgame.js