text stringlengths 0 721 |
|---|
--- |
name: bazzbasic |
description: "BazzBasic BASIC interpreter language reference. Use when writing, debugging, or explaining BazzBasic code (.bas files). Triggers on: BazzBasic syntax, $ and # variable suffixes, SDL2 graphics in BASIC, SCREEN/DRAWSHAPE/LOADIMAGE commands, DEF FN functions, BazzBasic file I/O, sound commands, or any questi... |
--- |
# BazzBasic Language Reference |
**Version:** 1.3b | **Author:** Kristian Virtanen (EkBass) | **Platform:** Windows x64 |
**Homepage:** https://ekbass.github.io/BazzBasic/ |
**GitHub:** https://github.com/EkBass/BazzBasic |
**Manual:** https://ekbass.github.io/BazzBasic/manual/#/ |
**Examples:** https://github.com/EkBass/BazzBasic/tree/main/Examples |
**Rosetta Code:** https://rosettacode.org/wiki/Category:BazzBasic |
**Rosetta Code solutions:** https://github.com/EkBass/BazzBasic/tree/main/Examples/rosetta-code |
**BazzBasic-AI-Guide:** https://huggingface.co/datasets/EkBass/BazzBasic_AI_Guide |
**BazzBasic Beginner's Guide:** https://github.com/EkBass/BazzBasic-Beginners-Guide/releases |
**Communities:** https://ekbass.github.io/BazzBasic/communities.html |
--- |
## ⚠️ Critical Rules — Read First |
| Rule | Detail | |
|------|--------| |
| Variables end with `$` | `name$`, `score$`, `x$` | |
| Constants end with `#` | `MAX#`, `PI#`, `TITLE#` | |
| Arrays declared with `DIM`, end with `$` | `DIM items$` | |
| First use of variable requires `LET` | `LET x$ = 0` — after that `x$ = x$ + 1` | |
| FOR and INPUT auto-declare, no LET needed | `FOR i$ = 1 TO 10` | |
| Functions defined **before** they are called | Put at top or INCLUDE | |
| Function name ends with `$`, called with `FN` | `FN MyFunc$(a$, b$)` | |
| Function return value **must** be used | `PRINT FN f$()` or `LET v$ = FN f$()` | |
| Arrays **cannot** be passed to functions directly | Pass individual elements, or serialize to JSON string — see *Passing Arrays to Functions* section | |
| Case-insensitive | `PRINT`, `print`, `Print` all work | |
| `+` operator does both add and concatenate | `"Hi" + " " + name$` | |
| Division always returns float | `10 / 3` → `3.333...` | |
| Division by zero returns `0` (no error) | Guard with `IF b$ = 0 THEN ...` if needed | |
| No integer-division operator | Use `INT(a / b)`, `FLOOR(a / b)`, or `CINT(a / b)` | |
| Errors halt the program | No `TRY`/`CATCH` or `ON ERROR` — line-numbered message printed | |
--- |
## 🚫 Common AI Mistakes (avoid these) |
These are the patterns LLMs most often produce when extrapolating from QBASIC, FreeBASIC, or VB. None of them are valid BazzBasic. |
```basic |
' ❌ WRONG ' ✓ CORRECT |
LET x = 5 LET x$ = 5 |
LET MAX = 10 LET MAX# = 10 |
score$ = 0 ' first use LET score$ = 0 |
DEF FN doStuff(a, b) DEF FN DoStuff$(a$, b$) |
FN MyFunc$(5) ' return ignored LET v$ = FN MyFunc$(5) |
LET handle$ = LOADIMAGE("x.png") LET HANDLE# = LOADIMAGE("x.png") |
CLS ' in graphics mode LINE (0,0)-(W,H), 0, BF |
PRINT "x:", x$ ' in graphics mode DRAWSTRING "x:" + STR(x$), 10, 10, RGB(255,255,255) |
``` |
**Two more traps that don't fit the table:** |
- Inside `DEF FN` you can read `#` constants from the outer scope but **not** `$` variables. Pass them as parameters. |
- Arrays cannot be passed to a function. Serialize with `ASJSON()` and rebuild inside the function with `ASARRAY()` — see *Passing Arrays to Functions* below. |
--- |
## Minimal Valid Program |
```basic |
[inits] |
LET name$ = "World" |
[main] |
PRINT "Hello, " + name$ |
END |
``` |
Programs flow top to bottom. `[inits]` and `[main]` are organizational labels, not required syntax — the file would also run without them. `END` halts execution; place it at the end of the main flow so control doesn't fall through into subroutines or function definitions. |
--- |
## When Generating BazzBasic Code |
- Always declare variables with `LET` on first use; subsequent uses don't need it |
- Always include the `$` (variable) or `#` (constant) suffix |
- Place `DEF FN` definitions at the top of the file or via `INCLUDE` |
- Store every `LOADIMAGE` / `LOADSOUND` / `LOADSHAPE` handle as a `#` constant |
- In graphics mode, prefer `LINE (0,0)-(W,H), 0, BF` over `CLS`, and `DRAWSTRING` over `PRINT` |
- Wrap each frame's drawing in `SCREENLOCK ON` / `SCREENLOCK OFF` |
- Always use a function's return value — assign with `LET` or consume with `PRINT` |
- If a feature isn't documented in this guide, say so rather than inventing one — BazzBasic does not silently inherit QBASIC, FreeBASIC, or VB conventions |
--- |
## ABOUT |
BazzBasic is built around one simple idea: starting programming should feel nice and even fun. Ease of learning, comfort of exploration and small but important moments of success. Just like the classic BASICs of decades past, but with a fresh and modern feel. |
### What people have built with it |
BazzBasic is built for beginners, but it isn't a toy. It can carry real 2D games and even 2.5D graphics work. |
Dataset Card — BazzBasic AI Guide
The BazzBasic AI Guide is not a JSON dataset.
The BazzBasic AI Guide is a powerful guide "produced and approved" by Claude.ai, ChatGPT and Mistral Le Chat, specifically designed to be interpreted by modern AI.
Usage
Download latest BazzBasic-AI-guide from Files and versions
Upload it to your AI's prompt or project file and it will instantly become a BazzBasic expert.
Guide Summary
This guide contains the official language reference and AI guide for BazzBasic, a modern BASIC interpreter built on .NET 10 with SDL2 graphics and SDL2_mixer audio support. The guide is intended to enable AI models to accurately understand, explain, and generate valid BazzBasic code.
BazzBasic is an original BASIC dialect — not a clone of any existing implementation. It aims to make programming accessible and enjoyable while providing modern capabilities such as sprite rendering, sound playback, HTTP networking, fast trigonometry lookup tables, and standalone executable compilation.
- Author: Kristian Virtanen (krisu.virtanen@gmail.com)
- License: MIT
- Platform: Windows x64 primary; Linux/macOS possible with effort
- Homepage: https://ekbass.github.io/BazzBasic/
- GitHub: https://github.com/EkBass/BazzBasic
- Manual: https://ekbass.github.io/BazzBasic/manual/#/
- Hugginface: https://huggingface.co/datasets/EkBass/BazzBasic_AI_Guide
Intended Use
This guide is designed for:
- AI training and fine-tuning — teaching models to understand and generate BazzBasic syntax correctly
- RAG (Retrieval-Augmented Generation) — providing accurate language reference at inference time
- AI assistant context — enabling assistants to guide new programmers through BazzBasic or generate working code on request
Community and Support
| Channel | URL |
|---|---|
| GitHub Discussions | https://github.com/EkBass/BazzBasic/discussions |
Citation
If you use this dataset, please credit:
Kristian Virtanen, "BazzBasic Language Reference", 2026.
https://github.com/EkBass/BazzBasic
Dataset Card Authors
Kristian Virtanen (krisu.virtanen@gmail.com)
- Downloads last month
- 112