rem: this.stacks[i].leftChild = this.stacks[i+row]; this.stacks[i+row].rightParent = this.stacks[i]; this.stacks[i].rightChild = this.stacks[i+row+1]; this.stacks[i+row+1].leftParent = this.stacks[i]; 
add: this.piles[i].leftChild = this.piles[i+row]; this.piles[i+row].rightParent = this.piles[i]; this.piles[i].rightChild = this.piles[i+row+1]; this.piles[i+row+1].leftParent = this.piles[i]; 
context:   init: function() {    var i, row, col;    // All piles must have .leftParent and .rightParent fields for the mouse    // handler, and we need them to have .leftChild and .rightChild    for(i = 0; i < this.stacks.length; i++) {      var s = this.stacks[i];      s.leftParent = null; s.rightParent = null;      s.leftChild = null; s.rightChild = null;      s.leftFree = function() { return !(this.leftChild && this.leftChild.hasChildNodes()); };      s.rightFree = function() { return !(this.rightChild && this.rightChild.hasChildNodes()); };      s.free = function() { return !(this.leftChild && (this.leftChild.hasChildNodes() || this.rightChild.hasChildNodes())); };    }    // now set the non-null values where applicable    for(i = 0, row = 1, col = 1; i <= 20; i++) {      this.stacks[i].leftChild = this.stacks[i+row];      this.stacks[i+row].rightParent = this.stacks[i];      this.stacks[i].rightChild = this.stacks[i+row+1];      this.stacks[i+row+1].leftParent = this.stacks[i];      if(col==row) {        col = 1;        row++;      } else {        col++;      }    }    // convenience    this.foundation.free = function() { return false; };    this.waste.free = function() { return true; };  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/15f3df693ddf02fb9ee6a2662189220868368b23/pyramid.js/clean/pyramid.js