eod
eod, aka Elementesol on Discord is a joke programming language made by User:icecream17 based on the game Elemental on Discord.
An eod file consists of a bunch of c-commands, separated by 3 newlines.
stability
Properties of elements and collections of elements may change at any time. Additionally collections can be deleted. So any program is subject to breaking at any moment. However, element combos have never been changed, only deleted, and very few elements have been renamed, maybe to fix typos or correct capitalization.
c-commands
All c-commands start with a keyword, are followed by a newline, and then are followed by arguments separated by 2 newlines, and finally end with 3 newlines.
The memory of this program is in the form of two stack whose capacities is the number of elements currently in the server. The first stack holds the program, and the second stack represents the memory the program manipulates by default.
Invalid c-commands start a comment.
input
The input
c-command takes a channel name as an argument, and adds the next message in that channel to the stack. If there is an attachment, it will be interpreted as a txt file and appended to the message. If the message starts with three newlines, the rest of the message is instead stored as Eod code and run.
push
The push
c-command takes an arbitrary amount of #play channel commands as arguments. It then pushes the result of the last #play channel command onto the stack (it will wait for the bot to give a result). If a category or query is added, it pushes all elements of the collection to the stack in the sort order of the channel command. If memory overflows, the stack starts at the earliest index that doesn't overflow, and the bottom of the stack is lost.
pop
The pop
c-command pops two items from the stack, the name of a #play channel, and a message to send in that channel. If there is an input
c-command right after, it doesn't bother sending and processes the message as if it were received by the input
command.
extern
The extern
c-command pops two items from the stack, called "language", which must be the name of a language that can be interpreted instead of compiled, and "line". The language intepreter is initialized if it's not already, declaring stack1 and stack2 as variables whose values always correspond to the stacks of memory of the Eod program. After initialization, the line of code is run in that interpreted language.
output
The output
c-command takes no arguments and pops the last item from the stack to output it.
how to play eod (copied)
You start with four elements: Air, Earth, Fire and Water. In a play channel, you may combine elements through the use of plus signs, for example: Water + Fire
. This will give you an element.
Other ways to combine elements are through commas (Water, Fire
) and line breaks:
Water Fire
If an element doesn't exist yet, the bot will display the following: That combination doesn't exist! :red_circle:
. In this case, you may /suggest
an element that will create this combination. This will place the poll onto #voting, where you and other players may vote for this combination.
You may combine up to 21 elements at a time instead of just two like in the original Elemental 3.
advanced combining
All elements are assigned an ID in the format #<index>
. The first index is 1, which corresponds to the element Air
. These IDs can be used in place of the element name in #play channel commands. This is useful in cases when, for example:
- When two elements canonicalize to the same string.
- When an element would be interpreted as part of a command.
For a command that combines elements, a message sent will first be checked for a newline, then a plus sign, then a comma, and parsed according to the first separator that matches. The entire message is split with the separator, resulting in several tokens. Tokens are canonicalized as follows: Whitespace at the start or end is removed. Ignore case.
The most recently made element can be combined with more elements using the syntax +elem1+elem2+...
. It can be combined with itself n times with *n
. Finally, an arbitrary element can be combined with itself n times with *n <element>
.
You can only combine elements in your inventory, which as mentioned starts with Air
, Earth
, Fire
, and Water
.
other commands
?<element>
gets the info of an element
!p<element>
gets the elements that have a combination using the given element
!cat <categoryname>
gets a category
!q <queryname>
gets a query
!q <queryname>
gets your inventory
The result of a #play channel command is either the element made or referenced, or a collection of elements referenced (e.g. an inventory, category, or query).
Hello, world!
Hello, world!
has the id #619842, so it is possible to make a hello world program, but I'm too lazy.