Bruzzet
Jump to navigation
Jump to search
Bruzzet is a stack-based esoteric programming language under construction by User:DanielE. It has 9 commands:
| Command | What it does |
|---|---|
| ( | Opens stack function. |
| [ | Opens I/O function. |
| < | Opens math function. |
| { | Opens flow control function. |
| ) | Executes stack function. |
| ] | Executes I/O function. |
| > | Executes math function. |
| } | Executes flow control function. |
| - | Decreases value of next function. |
The language is called "Bruzzet" because it is a "bracket puzzle".
How it works
In Bruzzet, the distance between an opening bracket and a closing one determines which exact command is used. E.g., ({) has a distance of 1 between ( and ), and {)<)(>} would have 5. The command is executed once a closing bracket is reached.
| Type of brackets used | Distance | What it does |
|---|---|---|
| () | 1 | Pushes integer 1 to the stack. |
| () | 2 | Copies the last pushed item on the stack as a new push. |
| () | 3 | Moves the top item on the stack to the bottom. |
| () | 4 | Moves the bottom item to the top. |
| () | 5 | POP! |
| () | 6 | Resets the entire stack to 0s. |
| [] | 1 | Pushes the user's input as an integer on the stack. |
| [] | 2 | Prints the top item as an integer, but doesn't pop it. |
| [] | 3 | Prints the top item as an integer and pops. |
| [] | 4 | Prints the top item as a character, but doesn't pop it. |
| [] | 5 | Prints the top item as a character and pops. |
| <> | 1 | Adds the two top items as a single item. |
| <> | 2 | Penultimate item subtracted by top item. So, if the stack has: ...3,47,29, <..> would result in ..3,18. |
| <> | 3 | Multiplies the two top items as a single item. |
| <> | 4 | Penultimate item divided by top item. |
| <> | 5 | Penultimate item modulo top item. |
| <> | 6 | Penultimate item to the power of top item. |
| {} | 1 | If the top item is not 0, go back to the start of the program. |
| {} | 2 | Same as 1 but if top item is 0. |
| {} | 3 | Repeat everything inside until top item is 0. |
| {} | 4 | Same as 3 but until top item is not 0. |
| - | You can only use 1 at a time | Decreases the space value between brackets by 1. |