5 ms·
It's nice that it has instructions, but nobody read the instruction. tl;dr: type "run" to run the program. 10 print "Hello, world!" 20 goto 10 run Also:
by gus_massa 5y ago
It's nice that it has instructions, but nobody read the instruction. tl;dr: type "run" to run the program.
10 print "Hello, world!"
20 goto 10
run
Also: What is the tech stack? Which basic version are you emulating?
- zupreme 5y agoForgot about 10 goto 10 eh?
- James-Livesey 5y agoYou should find it works! Once you type run, the caret will disappear as the program does nothing infinitely. Press Esc to break the program to carry on! But it should be 20 goto 10 if you want to print the same text again and again.
- ngcc_hk 5y agoAmazing work. Cheers.
- stevekemp 5y agoNote that there is a bug: 10 PRINT "OK" 20 GOTO 1 That reports an error "Cannot go to a nonexistant line". I think "real" BASIC interpreters would fall-through to the 10-line. I know my own toy BASIC does: https://github.com/skx/gobasic https://github.com/skx/gobasic Edit: Have reported issue, so it doesn't get lost in this thread.
- James-Livesey 5y agoYeah, I've since fixed that bug when I saw it on GH Issues! Thanks for the bug report.
- tyingq 5y agoLooks like their own basic interpreter. There's a list of keywords here: https://github.com/James-Livesey/atto/blob/main/commands.js#L7 https://github.com/James-Livesey/atto/blob/main/commands.js#... There are some drawing commands, getpixel, etc.
- James-Livesey 5y agoI wanted it to be as lightweight as possible, with only a few support libraries to show the Markdown content for docs etc. It's all done with vanilla HTML/CSS/JS and I put the new JavaScript modules functionality to good use to make my project less messy/more maintainable. The BASIC version is actually all custom; it's my own style with a few additions/changes to normal BASIC, and it's all tokenised/parsed/evaluated/executed in my JS code.