Hi,
new here, and I'm trying to draw a map of rectangles but I can't seem to get it working. The program does not error, but the window just pops open then closes even though I have the mousewait command there.
it seems to be something with the read command. If I rem out the read and take out the if d=1 line it does draw the boxes and waits for a mouse click. Not sure why the read would cause this though.
SETSCREEN 470,500,0
LOCAL array[],x,y,d
DIM array[22][22]
x=10
y=20
// draw border walls
RESTORE map1
FOR r=1 TO 22
FOR c=1 TO 22
READ d
array[r][c]=d
IF d=1
DRAWRECT x,y,20,20,RGB (0,0,255)
ENDIF
x=x+20
NEXT
x=10
y=y+20
NEXT
SHOWSCREEN
MOUSEWAIT
STARTDATA map1:
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,8,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1
DATA 1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,1
DATA 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,5
DATA 1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,1
DATA 1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,0,1
DATA 1,0,1,0,1,0,0,0,1,0,1,0,1,1,1,1,1,0,1,1,0,1
DATA 1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,0,0,0,1,1,0,1
DATA 1,0,1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,0,1
DATA 1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,1
DATA 1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1
DATA 1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1
DATA 1,0,1,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1
DATA 1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,0,1,0,1
DATA 1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,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