text
stringlengths
0
721
```
Output:
```
Krisu the Bass, lvl 99
Row 1: [.X]
Pi is roughly 3.14
```
---
## Math Functions
| Function | Description |
|----------|-------------|
| `ABS(n)` | Absolute value |
| `ATAN(n)` | Arc tangent |
| `ATAN2(n, n2)` | Returns the angle, in radians, between the positive x-axis and a vector to the point with the given (x, y) coordinates in the Cartesian plane |
| `BETWEEN(n, min, max)` | TRUE if min ≤ n ≤ max |
| `INBETWEEN(n, min, max)` | TRUE if min < n < max (strictly between, not equal) |
| `CEIL(n)` / `FLOOR(n)` | Round up / down |
| `CINT(n)` | Round to nearest integer |
| `CLAMP(n, min, max)` | Constrain n to [min, max] |
| `COS(n)` / `SIN(n)` / `TAN(n)` | Trig (radians) |
| `DEG(rad)` / `RAD(deg)` | Radians ↔ degrees |
| `DISTANCE(x1,y1, x2,y2)` | 2D Euclidean distance |
| `DISTANCE(x1,y1,z1, x2,y2,z2)` | 3D Euclidean distance |
| `EXP(n)` | e^n |
| `INT(n)` | Truncate toward zero |
| `LERP(start, end, t)` | Linear interpolation (t: 0.0–1.0) |
| `LOG(n)` | Natural logarithm |
| `MAX(a, b)` / `MIN(a, b)` | Larger / smaller of two |
| `MOD(a, b)` | Remainder |
| `POW(base, exp)` | Power |
| `RND(n)` | Random integer 0 to n-1 if n > 0 |
| `RND(0)` | Float between 0.0 and 1.0 (IE: 0.5841907423666761) |
| `ROUND(n)` | Standard rounding |
| `SGN(n)` | Sign: -1, 0, or 1 |
| `SQR(n)` | Square root |
**Math constants:** `PI#`, `HPI#` (PI/2), `QPI#` (PI/4), `TAU#` (PI*2), `EULER#`
---
## Variable Functions
| Function | Description |
|----------|-------------|
| `ISSET(name)` | `1` if the named variable (`$`) or constant (`#`) is declared, `0` otherwise. Argument is **not evaluated** — `ISSET(undef$)` safely returns `0`. |
`ISSET` is the only language-introspection function and it has tight rules:
- **Scalars only.** Variables (`$`) and constants (`#`). Arrays and array elements are stored separately — `ISSET(arr$)` and `ISSET(arr$(0))` always return `0`, never an error.
- **Bare name only.** No expressions, no string literals, no numbers. These all error with "invalid parameter":
```basic
ISSET(a$ + b$) ' WRONG: expression
ISSET("a$") ' WRONG: string literal
ISSET(42) ' WRONG: number
ISSET() ' WRONG: empty
```
- **Suffix is part of the name.** `a$` and `A#` are different names:
```basic
LET a$ = "foo"
PRINT ISSET(a$) ' 1
PRINT ISSET(A#) ' 0
```
- **`LET name$` (no value) still counts as set.** `LET` always registers the variable; the value just defaults to empty string for `$` and zero for numeric. `ISSET` reports declaration, not "has a meaningful value".
Typical use is guarding optional setup:
```basic
IF NOT ISSET(playerName$) THEN
LET playerName$ = "Anonymous"
END IF
```
---
## Graphics
```basic
SCREEN 12 ' 640×480 VGA
SCREEN 0, 800, 600 ' Custom size
SCREEN 0, 1024, 768, "My Game" ' Custom size + title
FULLSCREEN TRUE ' Borderless fullscreen (graphics only)
FULLSCREEN FALSE ' Windowed
```
| Mode | Resolution |
|------|-----------|
| 1 | 320×200 |
| 2 | 640×350 |
| 7 | 320×200 |
| 9 | 640×350 |
| 12 | 640×480 ← recommended |
| 13 | 320×200 |
### Drawing Primitives
```basic
PSET (x, y), color ' Pixel