Among Us
A program reads like the chat of a match, all colours and SUS.
Zero player rodent, 2021 · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Zero player rodent made Among Us in 2021, after the game. The code is meant to look like the talk in a match. A colour names a command and SUS runs it, so RED SUS adds 1 and ORANGE SUS SUS SUS adds 30. Memory is two accumulators and a stack. WHO and WHERE make the only loop. They compare the top of the stack with the second accumulator and see every value as wrapping around 0 to 255, though the numbers themselves have no limit.
The machine
| Colour | What SUS does |
|---|---|
RED WHITE | Add 1 to accumulator 1, or take 1 away |
ORANGE PINK | Add 10 to it, or set it to 0 |
BROWN | Set it to the top of the stack |
BLUE PURPLE | Push accumulator 1; pop |
YELLOW | Push a byte of input |
GREEN BLACK | Print the top as a character or as a number |
LIME | Add the top to itself |
CYAN | Pop a random number of times, at most accumulator 1 |
| Word | Does |
|---|---|
VENTED SUSSY ELECTRICAL | Add 10 to accumulator 2, take 1 away, or set it to 0 |
WHO? | Go past the next WHERE if the top equals accumulator 2 |
WHERE? | Go back to the last WHO if it does not |
The specification leaves open what an empty stack and the end of the input give. Both read as 0 in this implementation. The cat and reverser need that to stop, and so does the truth machine on 0.
Example
SUS runs the last colour again, so a letter is a few tens and a few ones.
SUS runs the last colour again, so a letter is a few tens and a few ones.
The truth machine prints its input, then takes 48 from it with one WHITE and 47 more SUS. On 0 the first WHO jumps past the loop. On 1 it prints 1 forever.
The Hello World pushes a line feed first and the H last, 14 characters in all. Then VENTED and SUSSY set accumulator 2 to 14, and the loop prints one character and takes 1 away until it reaches 0.
Patterns it teaches
- Stack machines: a stack beside two accumulators.
- Nondeterminism:
CYANpops a random number of values.
Further
See also
Stack-based
Write your own in Run Convert a program from Among Us
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: among-us.
Command line
shib run among-us -e 'RED SUS
BLUE SUS
WHO?
YELLOW SUS
GREEN SUS
WHERE?' --input 'sus '