esolang

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

Expected: Hi

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

ColourWhat SUS does
RED WHITEAdd 1 to accumulator 1, or take 1 away
ORANGE PINKAdd 10 to it, or set it to 0
BROWNSet it to the top of the stack
BLUE PURPLEPush accumulator 1; pop
YELLOWPush a byte of input
GREEN BLACKPrint the top as a character or as a number
LIMEAdd the top to itself
CYANPop a random number of times, at most accumulator 1
WordDoes
VENTED SUSSY ELECTRICALAdd 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.

Expected: 0

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

Further

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'
shib manual among-us

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/among-us.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org