From: Svjatoslav Agejenko Date: Sat, 31 May 2025 03:51:00 +0000 (+0300) Subject: Limit maze complexity X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=f39ccc72bb465d06dd6221838a89f7966731cefa;p=qbasicapps.git Limit maze complexity --- diff --git a/3D GFX/Galaxy explorer/screenshot.png b/3D GFX/Galaxy explorer/screenshot.png new file mode 100644 index 0000000..28550e6 Binary files /dev/null and b/3D GFX/Galaxy explorer/screenshot.png differ diff --git a/3D GFX/Maze explorer/mazeexplorer.bas b/3D GFX/Maze explorer/mazeexplorer.bas index ef931bb..3b7353d 100755 --- a/3D GFX/Maze explorer/mazeexplorer.bas +++ b/3D GFX/Maze explorer/mazeexplorer.bas @@ -1,3 +1,4 @@ +DECLARE SUB verifyTsrIsLoaded () ' Evolving 3D Maze explorer. ' ' By Svjatoslav Agejenko. @@ -25,16 +26,16 @@ DECLARE FUNCTION getByte! (addr!) DECLARE SUB start () DECLARE SUB animate () -DIM SHARED px(1 TO 5000) -DIM SHARED py(1 TO 5000) -DIM SHARED pz(1 TO 5000) -DIM SHARED rpx(1 TO 5000) -DIM SHARED rpy(1 TO 5000) -DIM SHARED rpe(1 TO 5000) +DIM SHARED px(1 TO 500) +DIM SHARED py(1 TO 500) +DIM SHARED pz(1 TO 500) +DIM SHARED rpx(1 TO 500) +DIM SHARED rpy(1 TO 500) +DIM SHARED rpe(1 TO 500) -DIM SHARED l1(1 TO 5000) -DIM SHARED l2(1 TO 5000) -DIM SHARED lc(1 TO 5000) +DIM SHARED l1(1 TO 500) +DIM SHARED l2(1 TO 500) +DIM SHARED lc(1 TO 500) DIM SHARED nl, np @@ -66,29 +67,31 @@ pz(1) = 0 1 -' Increase the number of points and add a new point at the current position -np = np + 1 -px(np) = cx -py(np) = cy -pz(np) = cz - -' Increase the number of lines and define a line between the new point and the previous one -nl = nl + 1 -l1(nl) = np -l2(nl) = np - 1 -lc(nl) = INT(RND * 15) + 1 - -' Randomly change one of the coordinates for the next point -va = INT(RND * 3) - -SELECT CASE va -CASE 0 - cx = RND * 500 - 250 -CASE 1 - cy = RND * 100 - 50 -CASE 2 - cz = RND * 500 - 250 -END SELECT +IF np < 500 THEN + + ' Increase the number of points and add a new point at the current position + np = np + 1 + px(np) = cx + py(np) = cy + pz(np) = cz + + ' Increase the number of lines and define a line between the new point and the previous one + nl = nl + 1 + l1(nl) = np + l2(nl) = np - 1 + lc(nl) = INT(RND * 15) + 1 + + + SELECT CASE INT(RND * 3) ' Randomly choose orientation for the next move + CASE 0 + cx = RND * 500 - 250 + CASE 1 + cy = RND * 100 - 50 + CASE 2 + cz = RND * 500 - 250 + END SELECT +END IF + control animate @@ -283,7 +286,7 @@ POKE (extADDR + addr + 1), n1 END SUB SUB start -startText +verifyTsrIsLoaded SCREEN 7, , , 1 @@ -291,7 +294,7 @@ maxmove = 50 END SUB -SUB startText +SUB verifyTsrIsLoaded DEF SEG = 0 ' read first from interrupt table @@ -313,4 +316,5 @@ IF getWord(0) <> 1983 THEN SYSTEM END IF -END SUB \ No newline at end of file +END SUB + diff --git a/3D GFX/Maze explorer/screenshot.png b/3D GFX/Maze explorer/screenshot.png new file mode 100644 index 0000000..96348a3 Binary files /dev/null and b/3D GFX/Maze explorer/screenshot.png differ