News for hackers. Stuff that matters.
Re:WebMSX – Online MSX Emulator by andersonfreitas on Thursday September 24, 2015 @07:15PM (#10275442)
Is there a way to get a nice output of the famous "10 PRINT CHR$(205.5+RND(1)); : GOTO 10" on this?
Re:WebMSX – Online MSX Emulator by bentpins on Thursday September 24, 2015 @07:18PM (#10275466)
If like me you haven't seen that code before: https://www.youtube.com/watch?v=m9joBLOZVEo
Re:WebMSX – Online MSX Emulator by PhasmaFelis on Friday September 25, 2015 @09:45PM (#10281771)
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? :)
Re:WebMSX – Online MSX Emulator by andersonfreitas on Monday September 28, 2015 @07:10PM (#10293788)
Thank you for the explanation! The second version is really cool!

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/

Re:WebMSX – Online MSX Emulator by acidx on Thursday September 24, 2015 @11:40PM (#10276270)
Would a 2-lines nibbles game be better?

I've just typed the implementation by Ricardo Bittencourt (http://www.ricbit.com/mundobizarro/twoliners/) and it works. BGM included: https://imgur.com/a/PnE0s

Re:WebMSX – Online MSX Emulator by andersonfreitas on Friday September 25, 2015 @12:29AM (#10276367)
I wasn't aware of those two liners, impressive btw.