hi!
i have quite some experience at programming (c, asm, various basics), but i’m new to javascript. i’m currently trying to create an ultra-low resolution (80×50 in this version) framebuffer of sorts for animation that i would like to run at ~4 fps. all in all i have two problems:
1.
below is the code for drawing one frame. when drawing many frames, how do i make it draw them at the same spot (ie. overwrite the previous frame and not draw below it)?
how would i speed it up?
thankful for any help.
———-8<———-
function rnd(n)
{
____return Math.round(Math.random() * n);
}
var piccel = Array(4000);
var col = Array(“#000000”, “#009900”);
for(i=0; i<4000; i++) piccel[i] = rnd(1);
s = “<table width=640px height=400px cellpadding=0 cellspacing=0 border=0>”;
for(y=0, i=0; y<50; y++){
____s += “<tr>”;
_for(x=0; x<80; x++, i++){
___s += “<td bgcolor=”” + col[piccel[i]] + “”></td>”
_}
}
s += “</table>”;
document.write(s);