Drive-In Window extended
Commands and Syntax
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
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!
||Pauses the programm until the enter key is pressed|
||Outputs the value of person N (as ascii) and sets its value to 0|
||Set person N to menu_item|
||Set person N to menu_item - other - item|
||Set person N to menu_item + other_item|
||Set person N to person B|
||Increments person N by menu_item|
||Decrements person N by menu_item|
||Sets person N to 0|
||Increments person N by X|
||Decrements person N by X|
||Moves X from B to N|
||input one char (ascii value) into person N|
||input int (8 bit) into person N|
||exits the programm with 8-bit exit code N (not requiered)|
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!
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.
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.