Steve's Preface (Chapter 0)

Running Your English Program

[This page is still under development (some parts may not work every day)]

Let's start with a program the computer can run that you already know how to write.

Open cabinet
Take out Jam
Take out PB
Take out Bread
Open Jam
Open PB
Open Bread
Open other cabinet
Take out plate
Open drawer
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:

HTML5=JavaScript required
You can click this button to install Steve's script in this computer and run it.

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.

[memo to Steve: we can do conditionals and iteration and even subroutines and variables in Kitchen, if you want. How about this as a final Kitchen script:

Get up
Make PBJ
Go to School
... and of course it would error off when it gets to the "Go to School" line, perhaps with some cutsie message about there's no school because of COVID, or at least that this computer doesn't know about school.]

Are you ready to start programming for real? That's next.

<<Previous | ToC | Next >>

[2021 February 18]