eggplant π
April 29, 2018 Β· View on GitHub
A stack-oriented interpretted language created using Felix Plesoianu's "Make Your Own Programming Language" (http://scratch-lang.notimetoplay.org/index.html).
π is written entirely with emojis
Printing
- π : prints top of stack
- π π: prints whole stack (stack remains in tact)
Math
- β: Addition
- β: Subtraction
- βοΈ:Multiplication
- β: division
- βοΈ: square root
- βοΈ: mod
- 0οΈβ£1οΈβ£2οΈβ£3οΈβ£4οΈβ£5οΈβ£6οΈβ£7οΈβ£8οΈβ£9οΈβ£: numbers
Stack Operations
- ππ: duplicate top of stack
- π€π: throw away top of stack
- ππ: switch top of stack with second item on stack
- πππ:copy second item on stack and place copy on top of stack
- β«π: bring third item on stack to top
Variables, Constants, Strings
- π: define variable
- ππ: save value into variable
- π π: get value of variable
- ππ: define constant
- βοΈ: declare string
- ex:
βοΈ hello worldβοΈ
- ex:
Functions
- β»οΈ: declare function
- π«: declare end of function
- ex:
β»οΈ π βοΈ πβοΈ π π«- defines a function π, which prints the string
π
Arrays
- π: beginning of array
- π: end of array
- π: length of array
- π¬: reference item in array