rem: this.redealsRemaining--; var numStacks = this.stacks.length; var i, j;  var down = new Array(numStacks); var up = new Array(numStacks); var cards = [];  var map = {}; map.cards = new Array(numStacks); map.faceUp = new Array(numStacks);  for(i = 0; i < numStacks; i++) { down[i] = 0; up[i] = 0; var stack = this.stacks[i]; map.cards[i] = new Array(stack.childNodes.length); map.faceUp[i] = new Array(stack.childNodes.length); j = stack.childNodes.length; while(stack.hasChildNodes()) { j--; var card = stack.removeChild(stack.lastChild); map.cards[i][j] = card; map.faceUp[i][j] = card.faceUp(); if(card.faceDown()) down[i]++; else up[i]++; card.setFaceDown(); cards.push(card); } }  cards = this.shuffle(cards);  for(i = 0; i < this.stacks.length; i++) { this.dealToStack(cards,this.stacks[i],down[i],up[i]); }  this.trackRedeal(map); 
context:   redeal: function() {    this.redealsRemaining--;    var numStacks = this.stacks.length;    var i, j;    // for redealing    var down = new Array(numStacks);    var up = new Array(numStacks);    var cards = [];    // for undoing the redeal in the future    var map = {};    map.cards = new Array(numStacks);    map.faceUp = new Array(numStacks);    // remove cards and store pattern    for(i = 0; i < numStacks; i++) {      down[i] = 0;      up[i] = 0;      var stack = this.stacks[i];      map.cards[i] = new Array(stack.childNodes.length);      map.faceUp[i] = new Array(stack.childNodes.length);      j = stack.childNodes.length;      while(stack.hasChildNodes()) {        j--;        var card = stack.removeChild(stack.lastChild);        map.cards[i][j] = card;        map.faceUp[i][j] = card.faceUp();        if(card.faceDown()) down[i]++;        else up[i]++;        card.setFaceDown();        cards.push(card);      }    }    // shuffle    cards = this.shuffle(cards);    // deal out again    for(i = 0; i < this.stacks.length; i++) {      this.dealToStack(cards,this.stacks[i],down[i],up[i]);    }    // track    this.trackRedeal(map);  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/0cba6dcc760eeefa28646ee9b3c9f46eaff0a7de/cardgame.js/buggy/cardgame.js