Computer Science Canada

2d arrays

Author:  ak [ Fri Apr 25, 2003 2:38 pm ]
Post subject:  2d arrays

How do u use 2d arrays? I tried 2 look all over the internet but couldn't find any sites explaining it.
Also, if how would I move a box back and forth on the screen and speed uo the process.
code:

var x:= 20
drawbox (20, 20,510, 390, 9)
randomize
randint (x, 0, 400)
for decreasing y: 300 .. 25

drawbox (x, y, x+ 20, y + 20, 2)
delay (20)
drawbox (x, y, x+ 20, y + 20, 0)
end for


thanks
Wink

Author:  Blade [ Fri Apr 25, 2003 3:40 pm ]
Post subject: 

http://www.compsci.ca/bbs/viewtopic.php?t=366

this tutorial explains everything on arrays... but if you mean initializing 2d arrays, then..

code:
var names:array 1..2, 1..2 of string:=init("john", "thomas","henry","ford")
put names(1,1)," ",names(1,2)

and you would would see john thomas on the screen..

less delay time to speed up the process


: