previous

page 27

next
check_first(card) in functions.js
function check_first(card) {
var ok; g_seq=[];
if (klass(card)=='final') {
ok=false;
} else if (empty(card)) {
ok=false;
} else {
if (klass(card)=='temp') {
ok=true;
} else { // must be main
var c=card.style.gridColumnStart; // column #
var r=card.style.gridRowStart; // row #
if (last(card)) {
g_seq=[parseInt(card.id)]; // used by move()
ok=true; // is last in column
} else { // check for sequence
var arr=[]; var ids=g_main_cols[c];
for (var i=r-1;i<ids.length;i++) {
arr.push(ids[i]);
}
if (check_sequence(arr)) {
g_seq=arr; ok=true;
} else {
ok=false;
}
}
}
}
return ok;
}

more →

previous
next