Topple/Topple 1
Jump to navigation
Jump to search
Interpreter Sources
- Topple 1 (C99)
- Topple 1 (C++) is currently in development
Overview
The first working version of Topple, completed on June 22nd, 2025.
Single-Character Commands
Unless otherwise specified, whitespace in any given code example is purely for organization| Command | Description | Example(s) | Output |
|---|---|---|---|
.
|
"Admits” a given character
|
a. b. c.
|
None |
@
|
Outputs all admitted characters and deletes them | a.b.c. @
|
abc
|
,
|
Outputs characters without admitting them
|
a,b,c,
|
abc
|
!
|
Takes user input | !. @
|
Whatever the user inputs |
?
|
Compares the last two admitted values. Returns ‘1’ if the two are the same or ‘0’ if the two are not the same | a.b.?. @
|
0
|
#
|
Returns a random number between 0 and 9 | #. @
|
0-9
|
&
|
Outputs all admitted characters without deleting them | a.b.c. &
|
abc
|
|
|
Deletes all admitted characters | a.b.c.| @
|
None |
:
|
Outputs an admitted character at a given index
|
a.b.c. 0:
|
a
|
;
|
Takes admitted character from a given index and copies it.
|
a.b.c. 0; @
|
abca
|
=
|
Defines variables
|
a=1
|
None |
~
|
Clears console | a.b.c. @ ~
|
None |
*
|
Quits the program |
Multi-character Commands
None of these will ignore whitespace
| Command | Description | Example(s) | Output |
|---|---|---|---|
^.
|
"Admits" a given variable | a=1 a^. @
|
1
|
^+
|
Increments a given variable by 1 | a=1 a^+ a^. @
|
2
|
^-
|
Decrements a given variable by 1 | a=1 a^- a^. @
|
0
|
<...>
|
FOR Loop, loops based on the last admitted character | 3.<a.@>
|
aaa
|
(...)
|
IF Statement, conditionally runs code based on the last admitted character | 1.(a.@)
|
a
|
[...]
|
ELSE Statement, will run only if the last IF Statement did not | 0.(a.@)[b.@]
|
b
|
{...}
|
WHILE Loop, Takes a given variable and loops for as long as it is non-zero
|
v=1 v.{a.@}
|
aaaaaaaaaaa...
|
_..._
|
Used for commenting | _a.b.c.@_
|
None |
Special Characters
| Character | Description |
|---|---|
\
|
New Line (\n) |