BASIC CHR 205.5

From Maze

Revision as of 12:16, 26 May 2010 by Nickm (Talk | contribs)
Jump to: navigation, search
 10 PRINT CHR$(205.5+RND(1)); : GOTO 10

This is a one-line adaptation that uses the same method as the three-line version in the Commodore 64 User's Guide, which is from 1982 and is the earliest known published version of the program.

How long is this program?

Forty characters, as written above.

The C64 supports abbreviations for keywords -- "?" for "PRINT" and generally unshifted first letter shifted second letter for other keywords. It seems that you also don't have to use spaces in a BASIC program pretty much anywhere.

So if you type this on a C64, you'll input the program using only 22 keystrokes (plus the return that you need at the end):

 1?cH(205.5+rN(1));:gO1
 

(Note that "c" will appear as the uppercase letter "C" and "H" will appear as a |-like symbol. "N" will appear as /-like symbol that is output by the program.)

If you list this, the representation that is produced is 32 characters long:

 1 PRINTCHR$(205.5+RND(1));:GOTO1

Runs on the Commodore PET

This program runs unmodified on a PET (released in 1977). To run it on the VICE PET emulator (xpet), you should first change to the "shifted" text mode by typing:

 poke 59468,12

CHR_205_Running_on_a_PET.png
665 × 260 pixels

Personal tools