Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exploring_amazing.bas [2023/05/19 19:27] – robert | exploring_amazing.bas [2024/10/19 22:01] (current) – typo fix robert | ||
---|---|---|---|
Line 12: | Line 12: | ||
AMAZING.BAS | AMAZING.BAS | ||
- | < | + | < |
10 PRINT TAB(28);" | 10 PRINT TAB(28);" | ||
20 PRINT TAB(15);" | 20 PRINT TAB(15);" | ||
Line 175: | Line 175: | ||
Compare this original code below to the spaghetti code version above. | Compare this original code below to the spaghetti code version above. | ||
- | < | + | < |
100 ' NAME: AMAZING*** | 100 ' NAME: AMAZING*** | ||
105 ' | 105 ' | ||
Line 335: | Line 335: | ||
Have fun with it on your Color Computer family machine. | Have fun with it on your Color Computer family machine. | ||
- | < | + | < |
100 REM NAME: AMAZING*** | 100 REM NAME: AMAZING*** | ||
105 REM | 105 REM | ||
Line 502: | Line 502: | ||
To knock down the wall to the left of a square, the generator moves its current column position 1 to the left, updates that square with the next count of visited squares then knocks down the right-hand wall. | To knock down the wall to the left of a square, the generator moves its current column position 1 to the left, updates that square with the next count of visited squares then knocks down the right-hand wall. | ||
- | To down down the wall in the up (or north) direction, the generator moves its current row position 1 row up, then knocks down the " | + | To knock down the wall in the up (or north) direction, the generator moves its current row position 1 row up, then knocks down the " |
* 0 this square has right AND bottom walls | * 0 this square has right AND bottom walls | ||
Line 511: | Line 511: | ||
The other array tracks whether a room has been "" | The other array tracks whether a room has been "" | ||
- | The right hand annotated example maze below shows the increating | + | The right hand annotated example maze below shows the increasing |
If the current row and column of the generator each a dead end or the exit and have no more directions to " | If the current row and column of the generator each a dead end or the exit and have no more directions to " | ||
Line 519: | Line 519: | ||
It starts with square 1 below the randomly chosen entrance, builds a list of possible directions to dig out a new square, then does so, " | It starts with square 1 below the randomly chosen entrance, builds a list of possible directions to dig out a new square, then does so, " | ||
- | <code> | + | <file> |
+ | V(R,C) array | ||
+ | |||
+ | 0 0 0 0 0 0 0 0 00 00 00 00 00 00 00 00 | ||
+ | 0 3 2 1 3 2 1 0 00 02 01 16 19 20 21 00 | ||
+ | 0 3 1 2 0 3 0 0 00 03 04 17 18 23 22 00 | ||
+ | 0 0 2 2 1 2 0 0 00 36 05 06 07 24 25 00 | ||
+ | 0 3 2 2 2 2 1 0 00 28 27 26 08 09 10 00 | ||
+ | 0 1 1 3 3 2 0 0 00 29 32 14 13 12 11 00 | ||
+ | 0 2 0 1 2 2 0 0 00 30 31 15 33 34 35 00 | ||
+ | 0 0 0 0 0 0 0 0 00 00 00 00 00 00 00 00 | ||
| | ||
| 3 2 1| 3 2 1| | 2 1 16|19 20 21| | | 3 2 1| 3 2 1| | 2 1 16|19 20 21| | ||
Line 533: | Line 544: | ||
| 2 0| 1| 2 2 0| |30 31|15|33 34 35| | | 2 0| 1| 2 2 0| |30 31|15|33 34 35| | ||
| | ||
- | V(R,C) array | + | </file> |
- | 0 0 0 0 0 0 0 0 00 00 00 00 00 00 00 00 | + | |
- | 0 3 2 1 3 2 1 0 00 02 01 16 19 20 21 00 | + | |
- | 0 3 1 2 0 3 0 0 00 03 04 17 18 23 22 00 | + | |
- | 0 0 2 2 1 2 0 0 00 36 05 06 07 24 25 00 | + | |
- | 0 3 2 2 2 2 1 0 00 28 27 26 08 09 10 00 | + | |
- | 0 1 1 3 3 2 0 0 00 29 32 14 13 12 11 00 | + | |
- | 0 2 0 1 2 2 0 0 00 30 31 15 33 34 35 00 | + | |
- | 0 0 0 0 0 0 0 0 00 00 00 00 00 00 00 00 | + | |
- | </code> | + | |
Without the spaghetti code, and with comments to help code the logic of the V(R,C) array controlling the " | Without the spaghetti code, and with comments to help code the logic of the V(R,C) array controlling the " |