esolang

Drive-In Window TC

The same fast food order, but now every person can take food home and bring it back.

BoundedBeans, 2023 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: iH

The idea

BoundedBeans made Drive-In Window TC in 2023 from Drive-In Window. In the original every person in the car holds one byte, so a program only ever has so many bytes. This version gives each person a stack of takeout. Two added lines push a person's value onto their own stack and pop it back, and a third is a comment.

Read the story

The specification proves it Turing complete by simulating P'' on a tape of 0s and 1s. Person 1 holds the cell under the pointer, Person 1's stack is the tape to the right and Person 2's stack the tape to the left.

The machine

Every line of Drive-In Window still works, and these are added.

LineDoes
Person N would like to get takeout.Push N's value onto N's stack
Person N would like to bring in food.Pop N's stack into N's value
Person N is leaving a review: text.Nothing, a comment without a period inside

Values are still bytes from 0 to 255 that wrap around. The stacks have no limit. Bringing in food from an empty stack stops the run with an error, as the specification says going past the edge of the tape breaks the program.

Example

Person 1 orders a $70 soup with $2 of salt, the code of H, and takes it out.

Person 1 orders a $70 soup with $2 of salt, the code of H, and takes it out. Then 33 dollars more make 105, the code of i, and that goes on the stack too. Bringing food back in comes out last first.

The original could not reverse its input, as it would need a byte for every character. Person 1 pushes a 0 to mark the bottom, takes out every character it reads, and then pays for them on the way back down until it reaches the 0.

Expected: desserts

Patterns it teaches

  • Camouflage: a meal order that hides byte cells, loops and now stacks.
  • Turing completeness: two stacks around one cell make an unbounded tape, which is all the original was missing.

Further

Pseudonatural

Stack-based

Write your own in Run Convert a program from Drive-In Window TC

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: drive-in-window-tc.

Command line

shib run drive-in-window-tc program.txt

The program is long; save it as program.txt first.

shib manual drive-in-window-tc

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/drive-in-window-tc.js

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

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