
previous

page 18
next
what to do at the end
I like to write a finale() function to call when the round is complete.
It needs to do two things: clear the highlight and highlight the first letters in lightblue. Try writing it yourself and working out where to call it.
finale() in functions.js
function finale() {
var el=document.getElementById(g_square_id);
el.style.backgroundColor='white';
var id=0;
for (var row=0;row<10;row++) {
var el=document.getElementById(id);
if (el.style.visibility=='hidden') break;
el.style.backgroundColor='lightblue';
id+=10;
}
}
var el=document.getElementById(g_square_id);
el.style.backgroundColor='white';
var id=0;
for (var row=0;row<10;row++) {
var el=document.getElementById(id);
if (el.style.visibility=='hidden') break;
el.style.backgroundColor='lightblue';
id+=10;
}
}
additions to move_on(id)
...
highlight(id);
}
}
} else {
finale();
}
}
highlight(id);
}
}
} else {
finale();
}
}
previous
next