Skip to content

Commit 4de9a51

Browse files
committed
Add extra array-runtime check
1 parent 5879814 commit 4de9a51

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/runtime/arrcheck1.bas

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
DIM a(23, 31) as Uinteger
3+
DIM p as UInteger = @a(0, 0)
4+
DIM i as Uinteger
5+
DIM j as UInteger
6+
DIM m as UInteger
7+
CLS
8+
9+
FOR i = 0 TO 23
10+
FOR j = 0 TO 31
11+
LET m = i * 32 + j
12+
LET a(i, j) = m
13+
PRINT AT 0, 0; i; " "; j; " "; " "
14+
IF PEEK(UInteger, p) <> m THEN
15+
PRINT INK 2; FLASH 1; " ERROR "
16+
PRINT "Expected "; m; ", got "; PEEK(Uinteger, p); ", read: "; a(i, j)
17+
STOP
18+
END IF
19+
LET p = p + 2
20+
NEXT j
21+
NEXT i
22+
23+
PRINT INK 4; FLASH 1; " OK "
24+

0 commit comments

Comments
 (0)