Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
exploring_amazing.bas [2023/05/19 19:23] robertexploring_amazing.bas [2024/10/19 22:01] (current) – typo fix robert
Line 12: Line 12:
  
 AMAZING.BAS AMAZING.BAS
-<code>+<code blitzbasic>
 10 PRINT TAB(28);"AMAZING PROGRAM" 10 PRINT TAB(28);"AMAZING PROGRAM"
 20 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY" 20 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
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.
  
-<code>+<code blitzbasic>
 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.
  
-<code>+<code blitzbasic>
 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 "bottom" wall of that square.+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 "bottom" wall of that square.
  
   * 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 ""walked" or "explored" - each time a maze room is explored, it is given a unique integer number from an increating counter.  The other array tracks whether a room has been ""walked" or "explored" - each time a maze room is explored, it is given a unique integer number from an increating counter. 
  
-The right hand annotated example maze below shows the increating count for each square.+The right hand annotated example maze below shows the increasing count for each square.
  
 If the current row and column of the generator each a dead end or the exit and have no more directions to "dig", then it will stop, rescan the array looking for any unused room next to an already dug room and start digging again from there. If the current row and column of the generator each a dead end or the exit and have no more directions to "dig", then it will stop, rescan the array looking for any unused room next to an already dug room and start digging again from there.
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, "knocking down" any right-hand or bottom walls it needs to as it goes. 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, "knocking down" any right-hand or bottom walls it needs to as it goes.
  
-<code>+<file> 
 +  V(R,C) array               W(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               W(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 "walls" it makes sense and you can see how the later more confusing versions still do the same thing, just in a different set of GOTO to GOTO steps. Without the spaghetti code, and with comments to help code the logic of the V(R,C) array controlling the "walls" it makes sense and you can see how the later more confusing versions still do the same thing, just in a different set of GOTO to GOTO steps.
Line 550: Line 552:
   * Set in a loop to redraw mazes of the same size as an easy screen saver   * Set in a loop to redraw mazes of the same size as an easy screen saver
   * Show or prompt for seeds to allow recreating mazes   * Show or prompt for seeds to allow recreating mazes
 +  * Run with Screen 51 for 51 characters wide screen
 +  * Run on CoCoVGA for 64 character wide screen
 +  * Add WIDTH80 and high speek POKE 65497,0 on CoCo3
  
 ===== Other Versions ===== ===== Other Versions =====