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.1b and is updated 23.03.2026 Finnish time.
# END METADATA
---
# BazzBasic Language Reference
BazzBasic is a BASIC interpreter for .NET 10 with SDL2 graphics and SDL2_mixer sound support. It is not a clone of any previous BASIC - it aims to be easy, fun, and modern. Released under MIT license.
**Version:** 1.1b (Released March, 2026)
**Author:** Kristian Virtanen (krisu.virtanen@gmail.com)
**Platform:** Windows (x64 primary); Linux/macOS possible with effort
**Dependencies:** SDL2.dll, SDL2_mixer (bundled).
**Github:** https://github.com/EkBass/BazzBasic
**Homepage:** https://ekbass.github.io/BazzBasic/
**Manual:** "https://ekbass.github.io/BazzBasic/manual/#/"
**Examples:** "https://github.com/EkBass/BazzBasic/tree/main/Examples"
**Github_repo:** "https://github.com/EkBass/BazzBasic"
**Github_discussions:** "https://github.com/EkBass/BazzBasic/discussions"
**Discord_channel:** "https://discord.com/channels/682603735515529216/1464283741919907932"
**Thinbasic subforum:** "https://www.thinbasic.com/community/forumdisplay.php?401-BazzBasic"
## Few examples:
**raycaster_3d:** https://raw.githubusercontent.com/EkBass/BazzBasic/refs/heads/main/Examples/raycaster_3d_optimized.bas
**voxel_terrain:** https://raw.githubusercontent.com/EkBass/BazzBasic/refs/heads/main/Examples/voxel_terrain.bas
**sprite load:** https://github.com/EkBass/BazzBasic/blob/main/Examples/countdown_demo.bas
**Eliza:** https://github.com/EkBass/BazzBasic/blob/main/Examples/Eliza.bas
## This guide:
**BazzBasic AI-guide:** https://huggingface.co/datasets/EkBass/BazzBasic_AI_Guide/tree/main
Just download the latest *BazzBasic-AI-guide-DDMMYYYY.md* where *DDMMYYYY* marks the date.
## CLI Usage
| Command | Action |
|---------|--------|
| `bazzbasic.exe` | Launch IDE |
| `bazzbasic.exe file.bas` | Run program |
| `bazzbasic.exe -exe file.bas` | Create standalone .exe |
| `bazzbasic.exe -lib file.bas` | Create tokenized library (.bb) |
IDE shortcuts: F5 run, Ctrl+N/O/S new/open/save, Ctrl+Shift+S save as, Ctrl+W close tab, Ctrl+F find, Ctrl+H replace.
In-built IDE is just a small very basic IDE which fires up when double-clicking *bazzbasic.exe*. Usage of Notepad++ etc. recommended.
### External syntax colors.
BazzBasic IDE is developed just so double-clicking *bazzbasic.exe* would bring something in the screen of a newbie. A person can use it, but it stands no chance for more advanced editors.
There are syntax color files for *Notepad++*, *Geany* and *Visual Studio Code* available at https://github.com/EkBass/BazzBasic/tree/main/extras
---
## Syntax Fundamentals
### Variables and Constants
Forget traditional BASIC types. Suffixes in BazzBasic define mutability, not data type.
Variables and arrays in BazzBasic are typeless: hold numbers or strings interchangeably
- $ = Mutable Variable
- # = Immutable Constant
```basic
LET a$ ' Declare without value
LET name$ = "Alice" ' Variable, string (mutable, $ suffix)
LET age$ = 19 ' Variable, integer (mutable, $ suffix)
LET price$ = 1.99 ' Variable, decimal (mutable, $ suffix)
LET PI# = 3.14159 ' Constant (immutable, # suffix)
LET x$, y$, z$ = 10 ' Multiple declaration
```
- All variables require `$` suffix, constants require `#`
- Typeless: hold numbers or strings interchangeably
- Must declare with `LET` before use (except FOR/INPUT which auto-declare)
- Assignment after declaration: `x$ = x$ + 1` (no LET needed)
- **Case-insensitive**: `PRINT`, `print`, `Print` all work
- Naming: letters, numbers, underscores; cannot start with number
### Comparison Behavior
`"123" = 123` is TRUE (cross-type comparison), but slower - keep types consistent.
### Scope
- Main code shares one scope (even inside IF blocks)
- `DEF FN` functions have completely isolated scope
- Only global constants (`#`) are accessible inside functions
### Multiple Statements Per Line
```basic