Programming Tryout

(You Already Know How)

<-- Watch Video

If you prefer, you can read the video transcript here.

Type your program here, then... 
 
  HTML5=JavaScript required
 

Sandwich Programming Language Quick Reference 

See Kitchen Get stuff Put it together Put stuff away




Close cabinet. Get knife from drawer. Open jelly. Put loaf back.
Close drawer. Get PB from pantry. Open other cabinet. Put PB back.
Close jam. Get piece of bread. Open pantry cabinet. Get another piece of bread.
Close loaf. Get plate from cupboard. Open peanut butter. Spread jam on bread.
Close peanut butter. Open bread. Put bread pieces together. Spread jelly on bread.
Get bread from pantry. Open cabinet. Put it on plate. Spread PB on bread.
Get jam from pantry. Open drawer. Put jam back.
Get jelly from pantry. Open jam. Put jelly back.


Here are descriptions of projects done in recent years by high school students in our Summer Workshop.
Not the first year, but you could be doing a project like one of these too:

https://alexanderhhs.github.io/NWAPW-Teams/index.html

https://sites.google.com/site/shsgalbraith/non-class-pages/nw-advanced-programming-workshop

 



Hints

Assume get <spread> on knife
You told the computer to spread something, and there's a knife in view, but you didn't tell it to get the spread (jam or PB or whatever) on the knife to do that, so it assumed that's what you wanted.
Assume line <nn> is a comment
Comments (notes to be read by people, rather than instructions for the computer) in Tom's Kitchen computer are normally enclosed in (parentheses) but if your command doesn't make any sense, it might be assumed to be a comment. If you intended this line to do something, try simplifying your language.
Assume open <object>
If you tell the computer to get something out of a closed container or a space like a cabinet, it might figure out and assume that you wanted it open (which it must be to do that).
I can't <verb> <object> unless it's open
You need to open a jug or box of cereal before you can pour it into your breakfast bowl. Sometimes the computer can figure it out and do it for you, but apparently not this time.
I can't spread <object> there
Kitchen computer knows how to spread jam and peanut butter on bread. If you get too creative, the computer will just get confused.
I don't know how to <verb>
The computer recognized that this is a verb, but it has not yet been programmed to do that. Maybe next week.
I don't know how to <verb> a <object>
The computer recognized this verb, but it has not been programmed to do it to that object.
I don't know what <word> means
There are over a 100,000 words in the English language, but Tom's Kitchen computer only knows a couple dozen or so. This word is not one of them.
I don't know what to do
Each line of your program (unless it's a comment, a note to yourself inside parentheses) each line should begin with a verb that Tom's Kitchen computer knows (see the list above).
I don't know where to <verb> <object>
You can move an object somewhere, or pour a liquid or cereal into a container, or else dip the spoon into a bowl of cereal, but if it's not obvious where you want this to happen, you need to tell the computer. Maybe what seems obvious to you is not obvious to the computer. Most programming languages, nothing is obvious, everything must be spelled out explicitly.
I don't see a <object> to <verb>
You can move an object somewhere, or pour a liquid or cereal into a container, or else dip the spoon into a bowl of cereal, but if the object is not out where you (and the computer) can see it, it's not possible.
I don't see bread to spread <object> on
Kitchen computer knows how to spread jam and peanut butter on bread, but it needs to see a slice of bread out in the open to do that.
I don't see two pieces of bread to put together
The computer thought you tried to tell it to put two pieces of bread together to make a sandwich, but it doesn't see two pieces of bread on the same plate, or maybe it just got confused trying to do it.
I don't seem to have any <object>
Kitchen computer knows the names of several ingredients that didn't make it in for this release. Maybe some time in the future.
I need a knife to <verb> <object>
The computer only knows how to spread jam or PB on bread using a knife, but there's no knife visible to use for that purpose..
I need an object to <verb>
Most of the things (verbs) you can tell the Kitchen computer to do, you need to tell it what to do it to. The computer did not see anything in your command that looked like something this verb can act on.
I'm all confused about line <nn>
This is a catch-all failure of the computer to make any sense of your command. Try saying in a different way whatever it is you wanted the computer to do.
Line <nn> is getting too complicated for me
This happens if you try to do something with a piece of bread that you didn't get out of the loaf wrapper, or if it already has something spread on it, or something like that.
Please do things one at a time
If you build a command that has several different words that say order things are done, the computer gets confused. Try to break your command into smaller parts.
There isn't any <object> there
You can tell the computer to get some things "from" a location (like the cabinet or fridge), but if it's not there, it can't do it. This is how it says that it can't.
We don't need any <object> in this kitchen
The Kitchen computer was designed to do a simple breakfast of a bowl of cereal or to make a PBJ sandwich. Some ingredients are not useful for those two purposes.
We ran out of bread
There are eight slices of bread in the load. If you make too many sandwiches, or if you waste the bread, it will run out.
You count different than I do
If you get several slices of bread out, you can refer to them by number (first, second, etc), but if you ask for a slice that isn't out of the loaf, what can it do?

There is more information in "Tom's Kitchen Computer Reference Manual" if you care to look.

Rev. 2022 May 10