Seas

From Esolang
Jump to navigation Jump to search

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).

🟦 - 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.
πŸ–‹βœ’οΈ - Mirrors.
πŸ“ - 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.
βž•βž–βœ–οΈβž— - Add, Subtract, Multiply and divide on 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

🌊🌊🌊🌊🌊🌊🌊
πŸ’‘πŸ”½πŸ—³πŸŸ¦πŸŸ¦πŸŸ¦πŸŸ¦
πŸŸ¦β–ΆοΈπŸ“πŸŸ¦πŸŸ¦πŸŸ¦πŸŸ¦ 
πŸŸ¦πŸŸ¦β–ΆοΈ1οΈβƒ£πŸ—³1️⃣◀️

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.