Talk:Drive-In Window

Jump to navigation Jump to search
Code Meaning
`Person N would like menu_item (with side_item).` Assign menu_item price (plus side_item) to person N (there can be an infinite amount of people).

I'm assuming you mean the number of persons is unbounded in general, but bounded for each program? If N has to be a constant written in decimal by the programmer, then the number of persons in a given program cannot be infinite. --Koen (talk) 22:55, 25 September 2013 (UTC)

Oh, sorry. I mean, "as many people as you want". I'll change the page accordingly. Thanks for telling me! --JWinslow23 (talk) 22:59, 25 September 2013 (UTC)

I'm also unsure how this works. Is there a way to specify the original amount of money a person holds? Or do they all start at the same arbitrary value, with the possibility to make money by purchasing negative-price items? --Koen (talk) 23:20, 25 September 2013 (UTC)

Did no one read the article?

All people start out as 0. If they buy menu items, ask for (or not want) sides, need more/less money, they change value.

Let's say Person 1 would like Chocolate Cake with Sweet and Sour Sauce. Let's say Chocolate Cake is \$10 and Sweet and Sour sauce is \$4. That assigns Person 1 as 10+4=14. If he would have held the Sauce, then he would be 10-4=6.

If he would also like Chocolate Cake with Gravy (must use the "would ALSO like" wording), and Gravy is \$9, then he would be 14 (curren value) + 10 + 9 = 33. If he buys his order, it would output "!". See what I'm getting at?

Can you say there not his. hey, Thats a good meme! (talk) 19:11, 8 January 2020 (UTC)

Good. --JWinslow23 (talk) 02:34, 26 September 2013 (UTC)

Comments

I figured out a style for comments. There are no native comments in Drive-In Window, but dishes and sides can have arbitrary names. For header comments, you can make a ton of ingredients you won't use. For inline comments, you have to specify it twice. Once as the dish name assigning the dish to \$0 (you could use sides but that requires a zero value entree and is longer, so it's better to use entrees). Then in the code, the shortest possible comment starter is `Person 1 would not like the ` followed by your comment. You could add a separator in there if you want, but it has to be in both places.

You can use any character other than the colon in comments, as far as I can tell (even periods work inside of statements, it seems to split by newlines rather than periods and exclamation marks, at least in the tio interpreter (which I think is copied from the 3snoW interpreter)).

This is an example of my commenting approach:

```Hi, welcome to Hello_world. Here is a menu.

[=============================================================: \$0
|This is a header comment.                                    : \$0
|This program prints out "Hello, world!"                      : \$0
|You can also have inline comments, but that requires you     : \$0
specify them twice, once completely missing the context.     : \$0
]=============================================================: \$0
==========================INLINE COMMENTS (PLEASE IGNORE)=====: \$0
===== THIS PRINTS OUT    : \$0
===== "H", WHICH IS THE  : \$0
===== FIRST LETTER IN    : \$0
===== "Hello World!".    : \$0
=====                    : \$0
===== THIS CODE IS       : \$0
===== LICENSED UNDER     : \$0
===== BLAH BLAH BLAH, BUT: \$0
===== NOT REALLY, BECAUSE: \$0
===== THIS IS AN EXAMPLE : \$0
===== TO SHOW HOW LONG   : \$0
===== COMMENTS LOOK.     : \$0

Rice Krispie Treat: \$10
Ice Cream: \$30
Cookies: \$70

Here are your sides.

Whipped Cream: \$1
Chocolate: \$2
Caramel: \$3

May I take your order?

Person 1 would like the Cookies with Chocolate.
Person 1 would not like the ===== THIS PRINTS OUT    .
Person 1 would not like the ===== "H", WHICH IS THE  .
Person 1 would not like the ===== FIRST LETTER IN    .
Person 1 would not like the ===== "Hello World!".    .
Person 1 would not like the =====                    .
Person 1 would not like the ===== THIS CODE IS       .
Person 1 would not like the ===== LICENSED UNDER     .
Person 1 would not like the ===== BLAH BLAH BLAH, BUT.
Person 1 would not like the ===== NOT REALLY, BECAUSE.
Person 1 would not like the ===== THIS IS AN EXAMPLE .
Person 1 would not like the ===== TO SHOW HOW LONG   .
Person 1 would not like the ===== COMMENTS LOOK.     .
Person 1 will pay for his order!
Person 2 would like the Ice Cream, hold the Whipped Cream.
Person 2 would also like what Person 1 has.
...

OK, that will be \$1.14. Thanks for coming!
```

BoundedBeans (talk) 23:30, 26 June 2023 (UTC)