rem: var rowStart = card.row * 8, rowEnd = rowStart + 8; var target = null; var f, c, ok; 
add: var row = this.rows[card.row]; var f, c, ok, target = null; 
context: Mod3.autoplayMove = function() {  for(var i = 0; i < 8; i++) {    var card = this.stacks[i].lastChild;    if(!card) continue;    var rowStart = card.row * 8, rowEnd = rowStart + 8;    var target = null;    var f, c, ok;    if(card.rowNum===0) {      // we want to move it to an empty space, but only if there are no stray cards in the row      // (otherwise we should leave the user to choose which specific cards to put in the spaces)      ok = true;      for(c = rowStart; ok && c < rowEnd; c++) {        f = this.foundations[c];        if(f.hasChildNodes()) { if(f.firstChild.number()!=f.baseNumber) ok = false; }        else if(!target) target = f;      }    } else {      // find where to move |card| to, and check that the other foundation on the row for the      // same suit has reached at least the same height      ok = false;      for(c = rowStart; !target && c < rowEnd; c++) {        f = this.foundations[c];        if(this.canMoveTo(card, f)) target = f;      }      for(c = rowStart; !ok && c < rowEnd; c++) {        f = this.foundations[c];        var last = f.lastChild;        if(f!=target && f.baseCardInPlace() && last.isSameSuit(card)            && last.rowNum>=card.rowNum-1) ok = true;      }    }    if(!ok || !target) continue;    this.moveTo(card, target);    return true;  }  return false;};
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/16cf1285aa3c691e959e2aabb4cbf0501cad4a97/mod3.js/buggy/mod3.js