rem: var hardGame = (this.difficultyLevel==2); this.redealsRemaining--; var cards = []; var map = new Array(4); var r, s, end;  for(r = 0, s = 0; r < 4; r++, s = 13 * r) { var c = 0; while(this.isPileComplete(s) && c<13) s++, c++; map[r] = new Array(13 - c); for(var j = 0; j < 13 - c; j++) { var card = this.stacks[s+j].firstChild; if(card) card.parentNode.removeChild(card);  if(card || hardGame) cards.push(card); map[r][j] = card; } }  cards = this.shuffle(cards);   var easyGame = hardGame ? 0 : 1; for(r = 0, end = 13; r < 4; r++, end+=13) { var start = end - map[r].length + easyGame;  for(s = start; s < end; s++) this.dealToStack(cards, this.stacks[s], 0, 1); }  this.trackRedeal(map); 
add: this.doAction(new MontanaRedealAction()); 
context:   redeal: function() {    var hardGame = (this.difficultyLevel==2);    this.redealsRemaining--;    var cards = [];     var map = new Array(4);    var r, s, end; // r=row, s=stacknum    // remove cards    for(r = 0, s = 0; r < 4; r++, s = 13 * r) {      var c = 0;      while(this.isPileComplete(s) && c<13) s++, c++;      map[r] = new Array(13 - c);      for(var j = 0; j < 13 - c; j++) {        var card = this.stacks[s+j].firstChild;        if(card) card.parentNode.removeChild(card);        // in hard games we want the null's in the array too        if(card || hardGame) cards.push(card);        map[r][j] = card;      }    }    // shuffle    cards = this.shuffle(cards);    // deal    // in easy games the spaces go at the start of rows. in hard games they occur randomly    var easyGame = hardGame ? 0 : 1;    for(r = 0, end = 13; r < 4; r++, end+=13) {      var start = end - map[r].length + easyGame;      // dealToStack does the right thing when there are nulls in |cards|      for(s = start; s < end; s++) this.dealToStack(cards, this.stacks[s], 0, 1);    }    // track    this.trackRedeal(map);  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/0cba6dcc760eeefa28646ee9b3c9f46eaff0a7de/montana.js/buggy/montana.js