text stringlengths 0 275 |
|---|
# METADATA: |
Name: BazzBasic |
Description: BazzBasic BASIC interpreter language reference. Use when writing, debugging, or explaining BazzBasic code (.bas files). Triggers on BazzBasic syntax, BASIC programming with $ and # suffixes, SDL2 graphics in BASIC, or references to BazzBasic interpreter features |
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. |
Purpose: This guide has been provided with the idea that it would be easy and efficient for a modern AI to use this guide and through this either guide a new programmer to the secrets of BazzBasic or, if necessary, generate code himself. |
Version: This guide is written for BazzBasic version 1.1d and is updated 26.03.2026 Finnish time. |
# END METADATA |
--- |
# BazzBasic Language Reference |
**Version:** 1.1b (March 2026) | **Author:** Kristian Virtanen (EkBass) | **Platform:** Windows x64 |
**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 |
--- |
## ⚠️ 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 | Pass individual elements by value | |
| Case-insensitive | `PRINT`, `print`, `Print` all work | |
| `+` operator does both add and concatenate | `"Hi" + " " + name$` | |
| Division always returns float | `10 / 3` → `3.333...` | |
--- |
## 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. |
## STORY |
Although over the years, as my own skills have grown, I have moved on to more versatile and modern languages, BASIC has always been something that has been fun to try out many different things with. |
Sometimes it's great to just make a simple adventure game again, a lottery machine, a quiz, or even just those balls bouncing on the screen. |
BazzBasic was created with this in mind. |
I wanted to create a language that makes it easy for you to give free rein to your curiosity and program something. |
And when you finish your first little game, you may crave something bigger and better. |
Maybe one day you will move on to another programming language, but then BazzBasic will have succeeded in doing what it was intended for. |
To arouse your curiosity. |
## Variables & Constants |
```basic |
LET a$ ' Declare without value |
LET name$ = "Alice" ' String variable |
LET score$ = 0 ' Numeric variable |
LET x$, y$, z$ = 10 ' Multiple declaration |
LET PI# = 3.14159 ' Constant (immutable) |
LET TITLE# = "My Game" ' String constant |
``` |
**Scope:** All main-code variables share one scope (even inside IF blocks). |
`DEF FN` functions are fully isolated — only global constants (`#`) accessible inside. |
**Comparison:** `"123" = 123` is TRUE (cross-type), but keep types consistent for speed. |
### Built-in Constants |
- **Boolean:** `TRUE`, `FALSE` |
- **Math:** `PI`, `HPI` (π/2 = 90°), `QPI` (π/4 = 45°), `TAU` (2π = 360°), `EULER` (e) |
- **System:** `ROOT#` (program base directory path) |
- **Keyboard:** `KEY_ESC#`, `KEY_ENTER#`, `KEY_SPACE#`, `KEY_UP#`, `KEY_DOWN#`, `KEY_LEFT#`, `KEY_RIGHT#`, `KEY_F1#`…`KEY_F12#`, `KEY_A#`…`KEY_Z#`, `KEY_0#`…`KEY_9#`, `KEY_LSHIFT#`, `KEY_LCTRL#`, etc. |
--- |
## Arrays |
```basic |
DIM scores$ ' Declare (required before use) |
DIM a$, b$, c$ ' Multiple |
scores$(0) = 95 ' Numeric index (0-based) |
scores$("name") = "Alice" ' String key (associative) |
matrix$(0, 1) = "A2" ' Multi-dimensional |
Dataset Card — BazzBasic Language Reference
Usage
Download latest BazzBasic-AI-guide from Files and versions
Upload it as post attachment, project file etc. and your AI has all necessary information about BazzBasic.
Dataset Summary
This dataset 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 dataset 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
Out-of-scope use
This reference is specific to BazzBasic 1.0. It should not be used to represent other BASIC dialects (QBasic, FreeBASIC, Liberty BASIC, etc.), as BazzBasic has its own distinct syntax and conventions.
Dataset Structure
The dataset consists of a single comprehensive Markdown document covering the full BazzBasic language. Major sections:
| Section | Content |
|---|---|
| Syntax Fundamentals | Variables ($ suffix), constants (# suffix), scope, operators |
| Arrays | Dynamic arrays, associative arrays, multi-dimensional, mixed indexing |
| Control Flow | IF/ELSEIF/ENDIF, FOR/NEXT, WHILE/WEND, GOTO, GOSUB, labels |
| User-Defined Functions | DEF FN, isolated scope, recursion, libraries (.bb) |
| I/O Commands | PRINT, INPUT, LINE INPUT, INKEY, KEYDOWN, LOCATE, COLOR |
| Math Functions | ABS, SIN, COS, TAN, LERP, CLAMP, DISTANCE, MOD, POW, and more |
| Math Constants | PI, HPI, QPI, TAU, EULER |
| Fast Trigonometry | FastTrig lookup tables (~20x faster than SIN/COS), 1° precision |
| String Functions | MID, LEFT, RIGHT, SPLIT, REPLACE, INSTR, and more |
| File I/O | FileRead, FileWrite, FileExists, FileDelete, FileList |
| Network | HTTPGET, HTTPPOST |
| Sound | LOADSOUND, SOUNDONCE, SOUNDREPEAT, SOUNDSTOP, SOUNDSTOPALL |
| Graphics | SCREEN, SCREENLOCK, LINE, CIRCLE, PSET, PAINT, RGB |
| Sprite System | LOADSHAPE, LOADIMAGE, LOADSHEET, MOVESHAPE, ROTATESHAPE, DRAWSHAPE |
| Mouse Input | MOUSEX, MOUSEY, MOUSEB |
| Built-in Constants | Full key constant tables (arrows, function keys, numpad, alphabet, etc.) |
| Source Control | INCLUDE, compiled libraries (.bb) |
| Common Patterns | Game loop, HTTP, save/load, sound with graphics |
| Code Style | Naming conventions, program structure, subroutine indentation |
Key Language Characteristics
An AI model should understand these BazzBasic-specific rules to generate correct code:
Variable and constant suffixes
$suffix = mutable variable (numbers or strings, typeless)#suffix = immutable constant- Arrays declared with
DIM, accessed witharr$(index)
LET usage
LETdeclares a variable; use only once per variable- Subsequent assignments use bare
var$ = valuesyntax (no LET) - Declaring all variables upfront in an
[inits]subroutine is best practice
Scope
- Main program has a single flat scope
DEF FNfunctions have completely isolated scope — no access to global variables, only global constants (#)
Graphics
- Always use
SCREENLOCK ON / SCREENLOCK OFFfor flicker-free animation LINE (x1,y1)-(x2,y2), color, BF(filled box) is faster thanCLSfor clearing- Sprites are positioned by their top-left point
SCREENLOCKblocksGETCONSOLE— use array-based collision detection instead
FastTrig
FastTrig(TRUE)enables degree-based lookup tables for sin/cos- Use
FastCos(angle)/FastSin(angle)— angles in degrees, auto-normalized 0–359 - ~20x faster than
SIN/COS— essential for raycasting, particle systems, etc.
Naming conventions
- Variables:
camelCase$ - Constants:
UPPER_SNAKE_CASE# - Arrays:
camelCase$ - Functions:
PascalCase$(called withFNprefix) - Subroutine labels:
[sub:name]
Example Programs
Real BazzBasic programs available at the official repository:
| Program | Description | URL |
|---|---|---|
| raycaster_3d_optimized | 3D raycaster using FastTrig | https://raw.githubusercontent.com/EkBass/BazzBasic/refs/heads/main/Examples/raycaster_3d_optimized.bas |
| voxel_terrain | Voxel space terrain renderer | https://raw.githubusercontent.com/EkBass/BazzBasic/refs/heads/main/Examples/voxel_terrain.bas |
| countdown_demo | Sprite sheet loading demo | https://github.com/EkBass/BazzBasic/blob/main/Examples/countdown_demo.bas |
| Eliza | Classic AI chatbot port | https://github.com/EkBass/BazzBasic/blob/main/Examples/Eliza.bas |
More examples: https://github.com/EkBass/BazzBasic/tree/main/Examples
Data Collection
The reference document was authored directly by the BazzBasic interpreter developer, Kristian Virtanen. It represents authoritative, hand-written documentation of the language — not scraped or machine-generated content.
Community and Support
| Channel | URL |
|---|---|
| GitHub Discussions | https://github.com/EkBass/BazzBasic/discussions |
| Discord | https://discord.com/channels/682603735515529216/1464283741919907932 |
| ThinBasic subforum | https://www.thinbasic.com/community/forumdisplay.php?401-BazzBasic |
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
- 30