rem: if(p.hasChildNodes() && this.canMoveToPile(card, p)) return p; 
add: if(p.hasChildNodes() && p.mayAddCard(card)) return p; 
context:   getBestMoveForCard: function(card) {    const parent = card.parentNode;    const ps = parent.isNormalPile ? parent.following : this.piles, num = ps.length;    for(var i = 0; i != num; i++) {      var p = ps[i];      if(p.hasChildNodes() && this.canMoveToPile(card, p)) return p;    }    // look for an empty pile to move the card to    if(!parent.isReserve) return null;    var prev = parent.prev, next = parent.next;    while(prev || next) {      if(next) {        if(next.hasChildNodes()) next = null;        else {          p = !next.up.hasChildNodes() ? next.up : (!next.down.hasChildNodes() ? next.down : null);          if(p) {            if(this.canMoveTo(card, p)) return p;            else next = null; // another reserve is closer to p; it will be closer to any pile right of p too          } else next = next.next;        }      }      if(prev) {        if(prev.hasChildNodes()) prev = null;        else {          p = !prev.up.hasChildNodes() ? prev.up : (!prev.down.hasChildNodes() ? prev.down : null);          if(p) {            if(this.canMoveTo(card, p)) return p;            else prev = null;          } else prev = prev.prev;        }      }    }    return null;  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/05e21043701a5724e2c4368f9cf23b22050e0bda/regiment.js/buggy/regiment.js