| I've never even seen an MSX before, but I was big into the C64 and those early BASIC machines have a lot in common, so I decided to give it a try just for you. Turns out you can, with the caveat that you it won't look quite right unless you enter "SCREEN 1" first: 10 PRINT CHR$(1)CHR$(93.5+RND(1));: GOTO 10
The differences (assuming that you understand the original C64 statement, because I suspect no one but andersonfreitas will ever read this now that it's dropped off the front page):* The "SCREEN 1" statement puts the display into the second text mode, which has 32 columns and 8x8 characters. The default text mode is 40 columns and 6x8 characters, truncating the rightmost quarter of each character. All of the non-graphical characters are squeezed into the first six columns, so the default mode has no downside unless you want to use graphical characters. * The diagonal line characters are at points 29 and 30 in the international (i.e. non-Japanese) version of the MSX character code table (see http://www.tabalabs.com.br/msx/msx_tech_hb/msxtech_tabalabs...., page 317 (page)/320 (PDF)). However, the first 32 character values are normally interpreted as control codes instead of printable characters. To actually print those 32 graphical characters, you need to precede each one with control character 1, followed by character (desired character value + 64). So if you want character 29, you PRINT CHR$(1)CHR$(93). (BTW, the characters past 95 appear to print the same with or without a proceeding CHR$(1). I dunno.) Unlike the C64, the MSX also has a pair of triple-diagonal characters, so you can make a denser maze like this: 10 PRINT CHR$(203.5+RND(1));: GOTO 10
Or you can combine both and make a weird mixed-density maze like this: 10 PRINT CHR$(1)CHR$(93.5+RND(1)+INT(2*RND(1))*110);: GOTO 10
I'm particularly proud of that last one. See what I did there? :) |
I've never used an MSX or C64 before, but since I'm interested in generative art, I've became curious about these program when a book with the same title was released:
http://www.amazon.com/10-PRINT-CHR-205-5-RND/dp/0262526743/