previous

page 36

next
the auto facility - making it happen - 1

I found this new helper function useful:

function auto_place(id) {
if (id<13) {
g_final_col[0]=id;
} else if (id<26) {
g_final_col[1]=id;
} else if (id<39) {
g_final_col[2]=id;
} else {
g_final_col[3]=id;
}
}

On the next page, I'll introduce you to my auto_do() function which will work the magic of slowly moving the cards to their final positions.

But, of course, it will have to be called!

function auto() {
...
auto_do();
}

You also need a couple of additions to redeal.

function redeal() {
highlight_off();
g_z=50;
g_saves=[];
var el=document.getElementById('main_panel');
el.style.backgroundColor='green';
deal(); draw(); save_state();
}
previous
next