Announcing Basic Language With Graphics (Beta)
amasad (2406)

Hey everyone!

I've been working on a classic BASIC language inspired by Microsoft Atari Basic. It comes with a 50x50 display by default and makes it really easy to draw things and make games. The language is still in Beta and I'll be improving it over the coming weeks. For now here is the documentation and a sample snake game that I found on the internet and modified to make it work here. Please let me know what you think.

If you're curious you can find the source code for the interpreter here (https://repl.it/@amasad/pg-basic). Feel free to fix bugs and send patches.

[update] Docs moved here: https://docs.repl.it/misc/basic

[update 2] Changelog:

  • You can now use variables with multiple letters
  • LET is optional. You can define variables like so 10 X = 1
  • TEXT lets you draw text on the screen (refer to docs)
  • Display is now automatically focused after the program is run
  • GETCHAR handles long-presses better

[update 3] Changelog:

  • You can now create multidimensional arrays ARRAY a, 2
  • You can now draw an entire grid with one call DRAW
  • Refer back to docs
You are viewing a single comment. View All
TheDrone7 (1006)

Could you use QB64 as the BASIC compiler instead please.

amasad (2406)

@TheDrone7 if you write or find a good JavaScript compiler I will add it (the one we have now has a lot that's missing)

[deleted]

@amasad why javascript?

TheDrone7 (1006)

Can you share the current [email protected] I'll try adding to it.

[deleted]

@Coder100 c++ is faster

TheDrone7 (1006)

Oh, thank you. I'll see what I can do. @amasad

TheDrone7 (1006)

@amasad I almost gave up on working on it after seeing you write tests for everything.

StudentFires (327)

@amasad So, since this was done in JavaScript, I thought It wouldn't be irrelevant to point out that Repl's NodeJs is more outdated than my browser. Can you guys update it, or better yet set, up an automated update script? I've been trying to try out the newest JavaScript features.

TheDrone7 (1006)

Node.js in general has always been behind browser js iirc, you can still use the latest node js version by simply adding node to your package list. @StudentFires

TheDrone7 (1006)

Just search for node in the package manager and add it. @StudentFires

StudentFires (327)

@TheDrone7 How do I search the package manager? Lol, sorry I'm pretty new to Node and NPM.

TheDrone7 (1006)

I'm talking about the repl.it package manager. Node and npm can be confusing for beginners so repl.it provides a gui package manager. click on my profile and see my posts, you'll find a introduction to the repl.it editor post. Thay will give a quick overview of the repl.it editor. @StudentFires

StudentFires (327)

@TheDrone7 But still... wouldn't it be better if Node was already updated, for everyone who uses Repl.it?

StudentFires (327)

@TheDrone7 Hmm, I can't get it to work, I added node 13.12.0, but literally nothing changed. My code still failed. The package.json updated though.

TheDrone7 (1006)
  1. It'll obviously be better if node is updated by default but we always have workarounds until they actually do it. Me and a few other members of the replit discord have constantly been bugging the replit team about this but they do have other more important issues to fix and features to add.
  2. That is weird, repl.it normally installs all dependencies before running so it should not fail. You can try creating a file named exactly .replit with the contents: -
language = "nodejs"
run = "npm i && node index.js"

If it still doesn't, then there is an error in your code.
@StudentFires

StudentFires (327)

@TheDrone7 Hmm, why are we running what's npm i, everything els, from the .replit to && isn't new to me.

StudentFires (327)

@TheDrone7 Uhh, update: My repl was bugged, it didn't save anything past a certain point, it happens to me every once in a while. I'll realize it's not running my current code, but an outdated version, once I spot it, I try to copy my current code because Repl isn't saving an acknowledging my updates. This has resulted in severe data loss before. Also, the Repl crashed.

TheDrone7 (1006)
  1. npm i is short for npm install which basically reads all packages from your package.json file and installs them. && basically indicates the part after it should be executed after the command before it has finished executing. .replit are special replit files for custom commands and stuff.
  2. [email protected]