Write, Run, and Generate BASIC Code with AI
Features โข Demo โข Quick Start โข Documentation โข Examples
BScode BASIC IDE is a complete web-based development environment for classic BASIC programming. It features a fully functional BASIC interpreter, syntax-aware editor, and an AI-powered code generator that converts natural language descriptions into working BASIC code.
Whether you're learning BASIC, teaching programming concepts, or just nostalgic for the 8-bit era, BScode provides a modern interface for a timeless language.
- Full BASIC Language Support - PRINT, INPUT, IF/THEN/ELSE, FOR/NEXT, GOTO/GOSUB/RETURN
- Mathematical Functions - ABS, INT, SQR, RND, MOD, AND, OR, NOT
- String Operations - LEN, MID$, LEFT$, RIGHT$, CHR$, ASC, UCASE$, LCASE$
- Array Support - DIM statement for single-dimensional arrays
- Line Number Execution - Classic line-number based program structure
- Natural Language to BASIC - Describe what you want, get working code
- Smart Formatting - Automatically adds proper line numbers and syntax
- Instant Generation - Powered by advanced AI (BScode proprietary engine)
- Quick Prompts - One-click templates for common programs
- Line Numbers - Automatic line numbering and cursor tracking
- Syntax Highlighting - Clean, readable code presentation
- Tab Support - Indent with tab key
- Live Updates - Real-time line and column position display
- Interactive Console - Clear output display with color-coded messages
- INPUT Support - Runtime user input handling
- Copy Output - One-click copy of console contents
- Execution Timer - Shows program runtime
- Hello World
- Basic Calculator
- Loops and Counters
- Grade Calculator
- Multiplication Table
- Simple Interest Calculator
- Even/Odd Checker
- FizzBuzz
- Prime Number Checker
- Clone the repository
git clone https://github.com/yourusername/BScode.git
cd BScode- Open in browser
# Just open index.html in your browser
open index.html
# OR use a local server
python -m http.server 8000- Start coding!
- Type your BASIC program in the editor
- Press RUN to execute
- Use BScode AI to generate code from descriptions
Visit the live demo at your-demo-url.com
10 REM This is a comment
20 PRINT "Hello, World!"
30 INPUT "Enter your name: "; N$
40 PRINT "Hello, "; N$
50 END- Numbers: A, B, C, TOTAL, SCORE
- Strings: A$, NAME$ (trailing $ indicates string)
- Arrays: DIM ARR(10) (0-10, 11 elements)
' IF Statement
10 IF X > 10 THEN PRINT "Big" ELSE PRINT "Small"
' FOR Loop
20 FOR I = 1 TO 10
30 PRINT I
40 NEXT I
' GOTO
50 IF X < 5 THEN GOTO 20
' GOSUB (subroutine)
60 GOSUB 1000
70 RETURN10 LET A = 10 + 5 ' Addition
20 LET B = 20 - 8 ' Subtraction
30 LET C = 6 * 7 ' Multiplication
40 LET D = 100 / 4 ' Division
50 LET E = 17 MOD 5 ' Modulus (remainder: 2)
60 LET F = ABS(-15) ' Absolute value: 15
70 LET G = INT(3.7) ' Integer: 3
80 LET H = SQR(16) ' Square root: 410 LET S$ = "Hello World"
20 PRINT LEN(S$) ' Length: 11
30 PRINT LEFT$(S$, 5) ' Left 5 chars: "Hello"
40 PRINT RIGHT$(S$, 5) ' Right 5 chars: "World"
50 PRINT MID$(S$, 7, 5) ' Middle: "World"
60 PRINT UCASE$(S$) ' Uppercase: "HELLO WORLD"
70 PRINT LCASE$(S$) ' Lowercase: "hello world"10 REM Calculate Circle Area
20 INPUT "Enter radius: "; R
30 LET PI = 3.14159
40 LET AREA = PI * R * R
50 PRINT "Area = "; AREA
60 END10 REM Factorial Calculator
20 INPUT "Enter number: "; N
30 LET F = 1
40 FOR I = 1 TO N
50 LET F = F * I
60 NEXT I
70 PRINT "Factorial of "; N; " is "; F
80 END10 REM Fibonacci Sequence
20 INPUT "How many terms? "; N
30 LET A = 0
40 LET B = 1
50 PRINT "Fibonacci: ";
60 FOR I = 1 TO N
70 PRINT A; " ";
80 LET C = A + B
90 LET A = B
100 LET B = C
110 NEXT I
120 PRINT
130 END- Vanilla JavaScript - No frameworks, pure JS
- HTML5/CSS3 - Modern responsive design
- Custom Interpreter - From-scratch BASIC engine
- REST API - AI generation endpoint
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Contributions are welcome! Here's how you can help:
- Report Bugs - Open an issue with detailed reproduction steps
- Suggest Features - Share your ideas for new functionality
- Submit PRs - Fix bugs or add features
- Improve Docs - Help make documentation better
# Fork the repo
# Clone your fork
git clone https://github.com/yourusername/BScode.git
# Create a feature branch
git checkout -b feature/amazing-feature
# Make your changes
# Commit and push
git commit -m 'Add amazing feature'
git push origin feature/amazing-feature
# Open a Pull RequestDistributed under the MIT License. See LICENSE file for more information.
Ayo Codes
- GitHub: @ayocodes
- Inspired by classic 8-bit BASIC interpreters
- Thanks to all contributors and users
- Built with passion for retro programming
- Issues: GitHub Issues
- Email: ayobot70@gmail.com
Built by Ayo Codes
Ctrl/Cmd + Enter- Run programTab- Insert indentEsc- Close AI panel/menus
- Line Numbers - Always start with 10 and increment by 10 for easy editing
- Multiple Statements - Use
:to put multiple statements on one line - PRINT Formatting - Use
;for no space,,for tab spacing - String Concatenation - Use
;to join strings and variables - Debugging - Add
PRINTstatements to trace variable values
- File save/load functionality
- More string functions
- Graphics support (canvas)
- Sound commands
- Debug mode with step execution
- Variable watcher panel
- Code export (HTML, PDF)
- Mobile responsive improvements
Star โญ this repo if you find it useful!
