Skip to content

Commit efd3020

Browse files
committed
Add runtime test arrcheck2 for array testing
This one checks the array element position is correctly computed (chained multiplication).
1 parent b48bef5 commit efd3020

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/runtime/arrcheck2.bas

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

0 commit comments

Comments
 (0)