Cscalls
A program reads like the voice chat of a CS:GO round.
nmcassa, 2022 · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
nmcassa made Cscalls in 2022 out of CS:GO callouts. Every line is something a player might shout. One at Hello World! pushes a string, PEEK prints it, and Why is no one A jumps to the label HELP A.
Read the story
Memory is a stack of strings with a pointer into it, and a hand, which holds one value the way Tetris holds a piece. The only test compares the item at the pointer with the hand and jumps to a line number.
The machine
| Line | Does |
|---|---|
One at X | Push X and point at it |
team? | Push a line of input and point at it |
PEEK | Print the item at the pointer |
GRAB AWP / I'm loaded I can drop | Move the pointer down or up |
Tagged N times | Point at item N |
hacking istg pls report | Remove the item at the pointer |
What skin is that? | Copy the item at the pointer into the hand |
Drop me AK / YO INSPECT | Push the hand; print it |
WHERES MY TEAM | Print the whole stack |
HELP X / Why is no one X | A label; jump to it |
save pls i have $N | Jump to line N if the item at the pointer equals the hand |
Lines count from 0, which the truth machine needs. The interpreter is in Python, so each print ends with a line feed, as Python's print does.
Example
The truth machine keeps 0 in the hand and compares the input with it.
The truth machine keeps 0 in the hand and compares the input with it. On 0 it jumps to line 6, prints and ends. On 1 it moves the pointer down to the 1 it pushed, holds that, and loops on PEEK forever.
Patterns it teaches
- Stack machines: a stack with a movable pointer and one register.
Further
See also
Pseudonatural
Stack-based
Write your own in Run Convert a program from Cscalls
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: cscalls.
Command line
shib run cscalls -e 'team?
PEEK' --input 'cat'shib manual cscallsSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/cscalls.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org