+DECLARE SUB verifyTsrIsLoaded ()\r
' Evolving 3D Maze explorer.\r
'\r
' By Svjatoslav Agejenko.\r
DECLARE SUB start ()\r
DECLARE SUB animate ()\r
\r
-DIM SHARED px(1 TO 5000)\r
-DIM SHARED py(1 TO 5000)\r
-DIM SHARED pz(1 TO 5000)\r
-DIM SHARED rpx(1 TO 5000)\r
-DIM SHARED rpy(1 TO 5000)\r
-DIM SHARED rpe(1 TO 5000)\r
+DIM SHARED px(1 TO 500)\r
+DIM SHARED py(1 TO 500)\r
+DIM SHARED pz(1 TO 500)\r
+DIM SHARED rpx(1 TO 500)\r
+DIM SHARED rpy(1 TO 500)\r
+DIM SHARED rpe(1 TO 500)\r
\r
-DIM SHARED l1(1 TO 5000)\r
-DIM SHARED l2(1 TO 5000)\r
-DIM SHARED lc(1 TO 5000)\r
+DIM SHARED l1(1 TO 500)\r
+DIM SHARED l2(1 TO 500)\r
+DIM SHARED lc(1 TO 500)\r
\r
DIM SHARED nl, np\r
\r
\r
1\r
\r
-' Increase the number of points and add a new point at the current position\r
-np = np + 1\r
-px(np) = cx\r
-py(np) = cy\r
-pz(np) = cz\r
-\r
-' Increase the number of lines and define a line between the new point and the previous one\r
-nl = nl + 1\r
-l1(nl) = np\r
-l2(nl) = np - 1\r
-lc(nl) = INT(RND * 15) + 1\r
-\r
-' Randomly change one of the coordinates for the next point\r
-va = INT(RND * 3)\r
-\r
-SELECT CASE va\r
-CASE 0\r
- cx = RND * 500 - 250\r
-CASE 1\r
- cy = RND * 100 - 50\r
-CASE 2\r
- cz = RND * 500 - 250\r
-END SELECT\r
+IF np < 500 THEN\r
+\r
+ ' Increase the number of points and add a new point at the current position\r
+ np = np + 1\r
+ px(np) = cx\r
+ py(np) = cy\r
+ pz(np) = cz\r
+\r
+ ' Increase the number of lines and define a line between the new point and the previous one\r
+ nl = nl + 1\r
+ l1(nl) = np\r
+ l2(nl) = np - 1\r
+ lc(nl) = INT(RND * 15) + 1\r
+\r
+ \r
+ SELECT CASE INT(RND * 3) ' Randomly choose orientation for the next move\r
+ CASE 0\r
+ cx = RND * 500 - 250\r
+ CASE 1\r
+ cy = RND * 100 - 50\r
+ CASE 2\r
+ cz = RND * 500 - 250\r
+ END SELECT\r
+END IF\r
+\r
\r
control\r
animate\r
END SUB\r
\r
SUB start\r
-startText\r
+verifyTsrIsLoaded\r
\r
SCREEN 7, , , 1\r
\r
\r
END SUB\r
\r
-SUB startText\r
+SUB verifyTsrIsLoaded\r
\r
DEF SEG = 0 ' read first from interrupt table\r
\r
SYSTEM\r
END IF\r
\r
-END SUB
\ No newline at end of file
+END SUB\r
+\r