Let's start with a program the computer can run that you already know how to write.
Take out Jam
Take out PB
Take out Bread
Open other cabinet
Take out plate
Take out knife
Take first piece of bread out of package
Put on plate
Take second piece of bread out of package
Put on plate
Spread jam on bread
Spread PB on bread
Put bread pieces together
Do you think I'm joking? Tom made up a virtual computer -- that's like being in a virtual school during lockdown, not really the same, but it looks sort of like it, and mostly works the same -- that pretends to be your average kitchen, with a pseudo-English for its programming language. Not the whole English language, just the things we talked about so far. Like it probably wouldn't know about orange marmalade and raisins, which Tom puts on his own PB sandwich.
OK, here's your computer:
After you see how it works, you can click this button to copy Steve's script to this panel:
Like I said, it's pretty limited, but at least you can see that you can write (and run) computer programs. Later we will see how to do this kind of program in Java.
But first, have some fun in the virtual kitchen. You can click this button to copy Steve's Breakfast script into the edit panel.That's all this "kitchen" computer knows how to do, Breakfast and PBJ. But you can change them around and see what happens when you run it. If the computer can't figure out how to do what you told it -- or sometimes even if it can guess by making some assumption -- it will put a message in the white space under the kitchen counter. If you don't understand one of these messages, you can look them up here. If your program is taking too long, or gets stuck in a loop, you can click the red STOP sign in the lower left corner.
For a complete description of what this kitchen computer can do, see The Kitchen Reference Manual.
In stead of just watching somebody else's (Tom's) program run, we think you will have a lot more fun writing your own. Remember those program ideas on the previous page? The programs you could write in English? I'd bet you could run most of them in the Kitchen computer. Try the Guessing Game for starters. Follow the link for hints on how to get started.
Are you ready to start programming in Java? You can do that next if you like. But we think messing around in the Kitchen might be more fun, and more quickly give you something to show your friends and family. Set your own pace.
<<Previous | ToC | Next>>
[2021 April 10]