switch gr
Jump to navigation
Jump to search
- This is still a work in progress. It may be changed in the future.
switch gr is an esolang based on Tiny Gr, Whitespace and Piet created by User:Ractangle
Swiches
switch gr has 2 swiches:
- on/off
- mode
-
on/off:0
mode:0 -
on/off:1
mode:0 -
on/off:0
mode:1 -
on/off:1
mode:1
Syntax
Parts
A part is self explanatory. it's a part of the program
a line of a switch gr program is 2 (or 3 if you count the IMP part separate) parts:
- The IMP
- The command
- The arguments
The IMP
Just like in Whitespace, there is also an IMP, and you also have to retype the IMP once you end the current line's code
Code | Meaning |
---|---|
00 00 |
Stack manipulation |
00 10 |
Flow-control |
10 00 |
I/O |
10 10 |
Arithmetics |
The commands
- Stack manipulation
00 00
- push a value to stack00 10
- pop a value and push it to the other stack10 00
- push the bos to the top and repeat that int(tos)-1 times10 10
- pop the tos from the other stack and add it to the main stack
- Flow-control
00 00
- create a label00 10
- jump to a label unconditonaly10 00
- jump to a label if the tos is zero10 10
- jump to a label if the tos is equel to the next argument
- I/O
00 00
- charecter output00 10
- numeric output10 00
- chrecter input10 10
- numeric input
- Arithmetic