RUN
From Maze
(Difference between revisions)
| Line 1: | Line 1: | ||
| − | Imagine it's 1981[2?] and you've just sat down in front of your Commodore 64 (C64). As you stare at the television set attached to this small computer-in-a-keyboard object, you see the word "READY" and a blinking cursor. Earlier in the day a "neat little program"<ref name="c64" /> in the Random Graphics section of the manual caught your eye: <ref name="multiple">Commodore 64 User's Guide, p 53.</ref> | + | Imagine it's 1981[2?] and you've just sat down in front of your Commodore 64 (C64). As you stare at the television set attached to this small computer-in-a-keyboard object, you see the word "READY" and a blinking cursor. Earlier in the day a "neat little program"[1] in the Random Graphics section of the manual caught your eye: |
10 PRINT "{SHIFT-CLR/HOME}" | 10 PRINT "{SHIFT-CLR/HOME}" | ||
| Line 33: | Line 33: | ||
The three-line program introduced here is nearly equivalent to the one-line namesake of this book: | The three-line program introduced here is nearly equivalent to the one-line namesake of this book: | ||
| − | 10 PRINT CHR$(205.5 + RND(1)); : GOTO 10 | + | 10 PRINT CHR$(205.5 + RND(1)); : GOTO 10 |
The only difference is the condensed version doesn't clear the screen as in the first line of the expanded code. The first line of the three-line program clears the screen and places the first character in the upper left. The one-line program starts placing characters at the current location on screen and gradually pushes the other characters up as the maze draws: | The only difference is the condensed version doesn't clear the screen as in the first line of the expanded code. The first line of the three-line program clears the screen and places the first character in the upper left. The one-line program starts placing characters at the current location on screen and gradually pushes the other characters up as the maze draws: | ||
| Line 41: | Line 41: | ||
== Notes == | == Notes == | ||
| − | {{reflist}} | ||
| − | [1] | + | [1] Commodore 64 User's Guide, p 53. |
[2] It's unclear why the lines are ordered 10, 20, 40, but the omission of 30 is likely a copy error in the manual and therefore not of importance in discussing the code. | [2] It's unclear why the lines are ordered 10, 20, 40, but the omission of 30 is likely a copy error in the manual and therefore not of importance in discussing the code. | ||
