Limit maze complexity
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 31 May 2025 03:51:00 +0000 (06:51 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 31 May 2025 03:51:00 +0000 (06:51 +0300)
3D GFX/Galaxy explorer/screenshot.png [new file with mode: 0644]
3D GFX/Maze explorer/mazeexplorer.bas
3D GFX/Maze explorer/screenshot.png [new file with mode: 0644]

diff --git a/3D GFX/Galaxy explorer/screenshot.png b/3D GFX/Galaxy explorer/screenshot.png
new file mode 100644 (file)
index 0000000..28550e6
Binary files /dev/null and b/3D GFX/Galaxy explorer/screenshot.png differ
index ef931bb..3b7353d 100755 (executable)
@@ -1,3 +1,4 @@
+DECLARE SUB verifyTsrIsLoaded ()\r
 ' Evolving 3D Maze explorer.\r
 '\r
 ' By Svjatoslav Agejenko.\r
@@ -25,16 +26,16 @@ DECLARE FUNCTION getByte! (addr!)
 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
@@ -66,29 +67,31 @@ pz(1) = 0
 \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
@@ -283,7 +286,7 @@ POKE (extADDR + addr + 1), n1
 END SUB\r
 \r
 SUB start\r
-startText\r
+verifyTsrIsLoaded\r
 \r
 SCREEN 7, , , 1\r
 \r
@@ -291,7 +294,7 @@ maxmove = 50
 \r
 END SUB\r
 \r
-SUB startText\r
+SUB verifyTsrIsLoaded\r
 \r
 DEF SEG = 0     ' read first from interrupt table\r
 \r
@@ -313,4 +316,5 @@ IF getWord(0) <> 1983 THEN
   SYSTEM\r
 END IF\r
 \r
-END SUB
\ No newline at end of file
+END SUB\r
+\r
diff --git a/3D GFX/Maze explorer/screenshot.png b/3D GFX/Maze explorer/screenshot.png
new file mode 100644 (file)
index 0000000..96348a3
Binary files /dev/null and b/3D GFX/Maze explorer/screenshot.png differ