File size: 7,026 Bytes
f753e5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1af859e
 
abfdfa6
 
 
1af859e
 
f753e5a
 
 
 
 
 
 
 
 
 
 
 
 
4a86649
f753e5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
---
annotations_creators:
  - expert-generated
language_creators:
  - expert-generated
language:
  - en
license: mit
multilinguality:
  - monolingual
pretty_name: BazzBasic Language Reference
size_categories:
  - n<1K
source_datasets:
  - original
task_categories:
  - text-generation
  - question-answering
task_ids:
  - language-modeling
  - closed-domain-qa
tags:
  - basic
  - programming-language
  - interpreter
  - sdl2
  - game-development
  - bazzbasic
  - code
  - language-reference
---

# Dataset Card — BazzBasic Language Reference

## Usage

Download latest *BazzBasic-AI-guide-[DDMMYYYY].md* file, where *[DDMMYYYY]* presents the uploading date.

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.

- **Version covered:** BazzBasic 1.0 (released February 22, 2026)
- **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 with `arr$(index)`

**LET usage**
- `LET` declares a variable; use only once per variable
- Subsequent assignments use bare `var$ = value` syntax (no LET)
- Declaring all variables upfront in an `[inits]` subroutine is best practice

**Scope**
- Main program has a single flat scope
- `DEF FN` functions have completely isolated scope — no access to global variables, only global constants (`#`)

**Graphics**
- Always use `SCREENLOCK ON / SCREENLOCK OFF` for flicker-free animation
- `LINE (x1,y1)-(x2,y2), color, BF` (filled box) is faster than `CLS` for clearing
- Sprites are positioned by their **top-left point**
- `SCREENLOCK` blocks `GETCONSOLE` — 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 with `FN` prefix)
- 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)