Moaiscript
Moaiscript is a stack-based language created by Dtp09 in which the only acceptable characters to use are the Moai Emoji "๐ฟ" and "\n". This language was inspired by Chicken and has interpreters written by users Dtp09 and Eiim.
Layout
Moaiscript uses a stack pointer, memory table and a compare flag, making Moaiscript a Turing-Complete language.
Instructions
The command is determined by the quantity of Moais on a line. It ignores anything that is not a moai or \n. An line devoid of moai will not run anything and skip to the next line.
Number of Moyais | Name | Description |
---|---|---|
๐ฟ | input | Pushes character in input, determined by top stack value, to the stack. |
๐ฟ๐ฟ | output | Adds top stack value to the output as an ASCII character. Adds ๐ฟ to output instead if top stack value is 0. |
๐ฟ๐ฟ๐ฟ | write | Sets memory location (indicated by absolute value of top stack value) to 2nd-top stack value. |
๐ฟ๐ฟ๐ฟ๐ฟ | read | Pushes memory location (indicated by absolute vbalue of top stack value) to the stack. |
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ | subtract | Subtracts top stack value from the second top, pops them off the stack and pushes difference. |
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ | add | Adds top 2 stack values, pops them off the stack and pushes the sum. |
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ | multiply | Multiplies top 2 stack values, pops them off the stack and pushes the product. |
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ | compare | Sets the compare flag to true if both top stack values are equivalent, sets to false if not. |
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ | jump | Jumps to command relative to line, determined by top stack value, only if compare flag is true. |
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ... | push | Pushes (Number of Moais)-10 onto stack. |
Code Examples
Feel free to add any here if you create anything cool.
Hello, World!
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ
Cat program
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ
Cat program by Eiim (stack-only)
๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ
Interpreters
An interpreter was written by User:Dtp09 in javascript, and hosted on Replit here. It was previously hosted on Google Sites, but has been moved to Replit.
I made an IDE and from-scratch interpreter which can convert between Moaiscript and a human-readable format as well as having basic execution functionality. It may differ from Dtp09's interpreter with certain undefined behavior, but programs should be largely cross-compatable. MoaIDE also uses empty lines to print the state information to the console, which can make it much more useful for debugging. MoaIDE can be found here and its source here. Eiim (talk) 04:41, 12 March 2022 (UTC)