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:18] robertexploring_amazing.bas [2024/10/19 22:01] (current) – typo fix robert
Line 4: Line 4:
  
 ===== BASIC Computer Games: Microcomputer Edition 1978 ===== ===== BASIC Computer Games: Microcomputer Edition 1978 =====
 +
 I have been haunted for a long time by a program called AMAZING.BAS which I (and more than a million others) saw in BASIC Computer Games: Microcomputer Edition, edited by David H. Ahl back in 1978. I have been haunted for a long time by a program called AMAZING.BAS which I (and more than a million others) saw in BASIC Computer Games: Microcomputer Edition, edited by David H. Ahl back in 1978.
 +
 +I still have a copy of this book, partly because I really like George Beker's robot illustrations.
  
 That code is below, but without comments and loaded with GOTO pointing to GOTO ... I've never really understood how it worked. That code is below, but without comments and loaded with GOTO pointing to GOTO ... I've never really understood how it worked.
  
 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 172: 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 332: 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 499: 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 508: 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 516: 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 530: 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 547: 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 =====
Line 560: Line 568:
 ==== Microsoft Small BASIC 2011 ==== ==== Microsoft Small BASIC 2011 ====
  
-In 2010 and 2011, Microsoft built Small BASIC and to help a new generation of kids get into BASIC programming, worked with David Ahl and George Becker to port the 1978 book's Microsoft BASIC 3.0 code to the 2010 Small BASIC syntax.+In 2010 and 2011, Microsoft built Small BASIC and to help a new generation of kids get into BASIC programming, worked with David Ahl and George Beker to port the 1978 book's Microsoft BASIC 3.0 code to the 2010 Small BASIC syntax.
  
 [[https://social.technet.microsoft.com/wiki/contents/articles/16400.basic-computer-games-small-basic-edition-amazing.aspx|BASIC Computer Games: Small BASIC Edition amazing.sb]] [[https://social.technet.microsoft.com/wiki/contents/articles/16400.basic-computer-games-small-basic-edition-amazing.aspx|BASIC Computer Games: Small BASIC Edition amazing.sb]]
  
-It was great to see George Becker return to the robots of BASIC Computer Games, provide some background for the original robots that made the 1978 book so much more fun and bring some new robots as well!+It was great to see George Beker return to the robots of BASIC Computer Games, provide some background for the original robots that made the 1978 book so much more fun and bring some new robots as well!
  
 ===== Enjoy ===== ===== Enjoy =====