The Commodore 64

From Maze

(Difference between revisions)
Jump to: navigation, search
(→Conclusion)
(Got Rid of 2nd Person Intro)
Line 1:Line 1:
= =
= =
−
Imagine it's 1982 and you've just sat down in front of your Commodore 64. 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}"
 
−
20 PRINT CHR$(205.5 + RND(1));
 
−
40 GOTO 20
 
−
 
−
Like many microcomputers of its day, the C64 came with a BASIC interpreter built in so that once you could begin writing programs right out of the box. After you carefully type in the program from the manual[2], you input "RUN". The screen erupts into motion as lines flow onto the screen. As each row fills with symbols, it starts drawing on the next line. When the screen is full, the entire maze moves up and leaves space at the bottom for new characters to fill. The result is a dynamic maze. The three-line program introduced here is nearly equivalent to the one-line namesake of this book with the only difference being that the condensed version doesn't clear the screen as in the first line of the expanded code.
 
−
[tk-Photos of the program running on an actual C64, since we have screenshots of it all over the place before now]
+
[INTRO TO CHAPTER]
−
 
−
The three lines of code that create this continually generating maze do so because of the specific design of the C64, paired with the design of the BASIC language in which the program is written. The manual explains the code element by element, first introducing the idea of a character code and then pointing out the importance of the number 205.5 specifically. The explanation of how the code works is followed by something even more valuable: an invitation to modify the code, change it, and make it your own based on what you've read.
 
=The Commodore behind the Commodore 64=
=The Commodore behind the Commodore 64=

Revision as of 04:53, 23 July 2011

View this revision of The Commodore 64.

Personal tools