Seas
Seas is a 2D esoteric programming language made by User:AmNow and was made for TeamSeas.
Commands
The memory field is an infinite sea with the instruction pointer at 0,0 and moves rightward.
ππππ π³π¦π¦π¦ π¦π¦π¦π¦
Everything outside of a written program is initialized with a space or a random character from the printable ASCII range with a β chance. Program execution ends when the instruction pointer reaches the top of the sea. Every line must be the length of the first one. The first line can only have π (whitespace not allowed).
| Command | Effect |
|---|---|
| π¦ | NOP. |
| π | Ends the program, this can only be at the first line. |
| 0οΈβ£ through 9οΈβ£ | Push the corresponding digit to the stack. |
| π ΏοΈ | Pop the top two values on the stack and locate the coordinates in the sea and swap it with the accumulator. |
| π§Ύ | Swap the top of the stack with the accumulator. |
| π‘ | Set the accumulator to 0. |
| π | Clear the entire stack. |
| π | Reverse the stack. |
| π | Move the bottom-most element up to the top. |
| π | Move the top element to the bottom. |
| π | Reflects the instruction pointer's direction on an ascending mirror: The following conversion apply from the current to the new direction: left ⇒ down, right ⇒ up, up ⇒ right, down ⇒ left. |
| βοΈ | Reflects the instruction pointer's direction on an descending mirror: The following conversion apply from the current to the new direction: left ⇒ up, right ⇒ down, up ⇒ left, down ⇒ right. |
| π | Pop the top value of the stack, if it is 0, move up, otherwise move down. |
| π | Pop the top value of the stack, if it is 0, move left, otherwise move right. |
| β | Pops the top element, a, from the stack, removes the new top element, b, and pushes the sum of a + b onto the stack. |
| β | Pops the top element, a, from the stack, removes the new top element, b, and pushes the different of a - b onto the stack. |
| βοΈ | Pops the top element, a, from the stack, removes the new top element, b, and pushes the product of a * b onto the stack. |
| β | Pops the top element, a, from the stack, removes the new top element, b, and pushes the quotient of a - b, truncated to its integral tmema only, onto the stack. |
| πΌπ½βοΈβΆοΈ | Rotate the instruction pointer to match which way it is facing. |
| π‘ | Input a number and push it. |
| π | Input a Unicode Character and push it. |
| π³ | Pop the top value and output as a number. |
| π | Pop the top value and output as a Unicode Character. |
| βοΈ | Pop and discard. |
| βοΈ | Swap. |
| π§» | Duplicate. |
| π₯€ | Logical NOT the top of the stack. |
Programs
Truth-Machine
πππππππ π‘π½π³π¦π¦π¦π¦ π¦π¦0οΈβ£π¦π¦π¦π¦ π¦βΆοΈππ¦π¦π¦π¦ π¦π¦βΆοΈ1οΈβ£π³1οΈβ£βοΈ
Cat Program
A character-based cat program, which operates in an olamic fashion, shall be adduced below:
ππππ βΆοΈππ π½ πΌπ¦π¦βοΈ
Computational class
Seas can be proven to be Turing-complete by reduction from Reversible StackBit with only 10 instructions and no accumulator (arrows could be replaced by mirrors reducing it by 2 but for simplicity arrows will be used):
ππ¦0οΈβ£1οΈβ£πππ½πΌπ½βοΈβΆοΈ
0 is:
π 0οΈβ£ π¦ π¦
1 is:
π 1οΈβ£ π¦ π¦
~ is:
π π π¦ π¦
* is:
πππ π½βΆοΈβΆοΈ βΆοΈππ¦ π¦βΆοΈπΌ π¦π¦π¦
[abc] is:
πππ...πππ π½βΆοΈβΆοΈabcπ½βΆοΈβΆοΈ βΆοΈππ¦...βΆοΈππ¦ π¦βΆοΈπ¦...π¦π¦πΌ π¦π¦πΌ...π¦βοΈπ¦
There should be n amount of empty lines between third and fourth lines based on amount of nested loop times 2 inside, each time a nested loop occurs this amount is reduced by two.
Interpreter
- Common Lisp implementation of the Seas programming language. Please note that the concrete character set deployed constitutes a dependency on the Common Lisp implementation; in corollary, Unicode support may or may not be a feature incorporated in the personal environment. The interpreter at hand has been developed and tested with Steel Bank Common Lisp (SBCL) version 1.1.4 as part of the Lisp Cabinet 0.3.5 bundle.