Drive-In Window extended
Drive-In Window extended is an esoteric programming language based on Drive-In Window, created by User:Alex_s168. The layout is similar to what someone would order at a restaurant.
Commands and Syntax
Pre-program declarations
A Drive-In Window program always starts with a greeting and a restaurant declaration. Optionally also with a menu declaration. (recommended)
The menu contains constants. It consists of 2 parts (not all are required), the main dishes and the side dishes. The values of the main dishes can only be multiples of 10, while the side dishes can only be values from 1 to 9. Every value in the menu cannot be 0 or negative nor can it exceed 255. (only 8-bit integers)
After this comes the programm start declaration "May I take your order?"
Example of the menu and start:
Hi, welcome to ZheBurger. Here is the menu: Cheese burger: 20€ Here are the sides: Fries: 7€ May I take your order?
There are 2 possible currencies but you have to use the same one across the whole code! - Euro 3€ - Dollar $3
In-program commands
Variable creation
To "create" new variable(s) (=person) if you have no variables yet:
Hello! We are 3 people!
(creates 3 variables. From 1 to 3)
if you already have variables:
Person 5 joined us!
(creates the variable 5)
Loops and conditions
To repeat something until the value of the person is 0
Lets just do this until Person 3 has no more money: # do stuff Until here!
To execute something if a person has money
If Person 3 has money: # do stuff Until here! # optional else Otherwise: # do other stuff Until here!
Instructions
Code | Meaning |
---|---|
Just wait while we decide... |
Pauses the programm until the enter key is pressed |
Person N will pay for PRONOUN order. |
Outputs the value of person N (as ascii) and sets its value to 0 |
Person N would like menu_item. |
Set person N to menu_item |
Person N would like menu_item, hold the other_item. |
Set person N to menu_item - other - item |
Person N would like menu_item with other_item. |
Set person N to menu_item + other_item |
Person N would like what Person B has. |
Set person N to person B |
Person N would also like menu_item. |
Increments person N by menu_item |
Person N would not like menu_item. |
Decrements person N by menu_item |
Person N has no more money. |
Sets person N to 0 |
Person N needs X more. |
Increments person N by X |
Person N needs X less. |
Decrements person N by X |
Person N borrows X from Person B. |
Moves X from B to N |
Okay, what should Person N get? |
input one char (ascii value) into person N |
Okay, how much money should Person N have? |
input int (8 bit) into person N |
Okay, that will be N. |
exits the programm with 8-bit exit code N (not requiered) |
Examples
Cat:
Hi, welcome to ZheBurger. May I take your order? Hello! We are 1 people! Lets just do this until Person 1 has no more money: Okay, what should Person 1 get? Person 1 will pay for his order. Until here!
Truth machine:
Hi, welcome to TruthHouse. May I take your order? Hello! We are 2 people! Okay, how much money should Person 1 have? Person 2 would like what Person 1 has. Person 2 needs 48€ more. Lets just do this until Person 1 has no more money: Person 1 would like what Person 2 has. Person 1 will pay for his order. Person 1 would like what Person 2 has. Until here! Person 1 would like what Person 2 has. Person 1 will pay for his order.
Computational class
Drive-In Window is a bounded-storage machine, since a program doesn't have access to more bytes than the number of persons in it.
Implementations
- Transpiler to C written by User:Alex_s168: here