Language basics
Stack
LilTea is a stack-based programming language with a single stack. Every operations performs a action on the stack and pushes the result.
This is a domain specific language made for golfing challenges. Its based on JavaScript so you will have to have Node.js as interpretator and thats all.
Your are ready to use LilTea!
Atoms
Atoms are the main part of the language. They are built-in functions making solutions quite easier and faster. Below you can see a list of all the atoms LilTea supports and thanks to the implementation of the language and that they can be added easily so many more are on the way!
lilTea symbol | bigTea symbol | Explanation |
---|---|---|
+ | add | |
Pops the top 2 values and pushes their sum | ||
- | subtraction | |
Pops the top 2 values and pushes their difference | ||
* | subtraction | |
Pops the top 2 values and pushes their product | ||
/ | divide | |
Pops the top 2 values and pushes their quotient | ||
% | modulo | |
Pops the top 2 values and pushes their their remainder after division | ||
$ | at | |
Pushes the current iteration index | ||
null | ascendingSort | |
Sorts the top array in ascending order | ||
null | descendingSort | |
Sorts the top array in descending order | ||
null | square | |
Pops the top value and pushes it's square | ||
null | sqrt | |
Pops the top value and pushes it's square | ||
null | dup | |
Pushes the top value | ||
null | tan | |
Pops the top value and pushes it's tan | ||
null | sin | |
Pops the top value and pushes it's sin | ||
null | cos | |
Pops the top value and pushes it's cos | ||
null | empty | |
Pops everything | ||
null | stackLenght | |
Pushes the length of the stack | ||
null | element | |
Pops the top value and pushes the element of the top array at that index | ||
m | elementPop | |
Pops the top value and the top array and pushes the element at that index | ||
= | compare | |
Pops the top 2 values and pushes their equality | ||
p | ||
Print the top value | ||
P | printPop | |
Pop the top value and print it | ||
. | increment | |
Increment the top value with 1 | ||
_ | decrement | |
Decrement the top value with 1 | ||
null | toString | |
Converts a to string | ||
null | toInteger | |
Converts a to number | ||
null | toArray | |
Converts a to array | ||
null | fact | |
Pops a and pushes its factoriel | ||
null | ceil | |
Ceils a | ||
null | floor | |
Floors a | ||
g | bigger | |
Checks if the last element is bigger than the previous one | ||
l | less | |
Checks if the last element is less than the previous one | ||
& | bitswiseAnd | |
Push the bitwise AND comparisment of the last two elements | ||
| | bitswiseOr | |
Push the bitwise OR comparisment of the last two elements | ||
x | bitswiseXor | |
Push the bitwise XOR comparisment of the last two elements | ||
n | notEqual | |
Pops the top 2 values and pushes 1 if they are not equal and 0 if they are equal | ||
^ | pop | |
Pops the value depending on the modificator | ||
O | doubleDup | |
Duplicate the last two values | ||
s | swap | |
Swap the top 2 values | ||
t | debugPrintStack | |
prints the stack (debugging) | ||
~ | NOP | |
Does nothing. |