Love BASIC? Meet
LocoBasic – a lightweight, streamlined take on
Locomotive BASIC, built for speed and simplicity. Whether you're crunching numbers, testing ideas, or diving into retro vibes, LocoBasic has your back!
- Focused on calculations and the core of Locomotive BASIC.
- Faster than CPCBasicTS (Try it! (https://benchmarko.github.io/CPCBasicTS/?example=1st&implicitLines=true))
Key Features- Lightweight & Portable: Runs in your browser or on the command line with Node.js - compile directly to JavaScript.
- Essential Control Structures: Supports IF...ELSE, FOR, and WHILE.
- Subroutines: Use GOSUB and RETURN for modular programming (GOTO is not supported!)
- Mathematical Precision: JavaScript-powered calculations ensure accurate results.
- Utility Functions: Commands like ROUND, TIME, and string handling with STR$, LEFT$, and more.
- Simple Input & Output: PRINT and INPUT.
Getting Started- Run LocoBasic (https://benchmarko.github.io/LocoBasic/) in your browser – no installation required.
- Or, use Node.js for command-line execution.
- Check out the README (https://github.com/benchmarko/LocoBasic/#readme) for full details.
Let me know what you think. Happy coding!
Would be awesome to have that for a real CPC and using the 2nd register set of the Z80, to release the full power of the Z80! :) :) :)
At the time where I was using my CPC 664, a younger self, I was using a basic program to helping me playing a PBM (Play by Mail) game : Shaddam where you had to attack stars and conquer most of the map.
With informations from my spies the basic program could help me know if winning the star was possible by running many statistical trys and give me a win percentage. It took time to computer trys. It would have been nice to have LocoBasic at this time or any basic compiler :-)
Update: LocoBasic v0.1.74 with SVG support
- SVG Output
• You can now create Scalable Vector Graphics directly from your BASIC code.
• Hit the "Export SVG" button to download your creations
- Examples to check out:
• Sierpiński triangle: https://benchmarko.github.io/LocoBasic/?example=sierpin2 (https://benchmarko.github.io/LocoBasic/?example=sierpin2)
• Mandelbrot set (SVG isn't ideal for pixel art, but still): https://benchmarko.github.io/LocoBasic/?example=mandelbr (https://benchmarko.github.io/LocoBasic/?example=mandelbr)
• "Little Architect" demo using |CIRCLE and |RECT: https://benchmarko.github.io/LocoBasic/?example=archidr (https://benchmarko.github.io/LocoBasic/?example=archidr)
- Real-Time Clock RSX commands
• Get system date and time with |DATE and |TIME.
• Used in this ticking clock demo: https://benchmarko.github.io/LocoBasic/?example=drawclk (https://benchmarko.github.io/LocoBasic/?example=drawclk)
- Also included:
• Syntax highlighting editor for BASIC