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 20:02] – [How It Works] 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 | V(R,C) array | ||
Line 544: | 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| | ||
| | ||
- | </code> | + | </file> |
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 " |