Except computers mostly don't understand programs written in English. But Tom's speciality is telling computers to understand some other language besides the ones and zeros that is the computer's native language, so Kitchen is a special-purpose computeer that knows how to run programs written in English. A very small subset of English, but enough to let you see how easy it can be to program a computer.
For you computer geeks out there, Kitchen is Turing-complete. In principle, anything you can do in Java or C you can do in this computer, although a lot slower and less convenient. And your browser window is its only output. But it's a good start, or at least we think so.
The Kitchen Computer is still in development and some parts may not
work properly yet. Those we know about are marked here in pink.
If you try something and it doesn't work, please tell us so we can fix
it.
Error Messages, Why and How to Get Past Them
The Kitchen Program
Kitchen Objects (Nouns)
Kitchen Commands (Verbs)
Variables & Expressions
Conditionals
Iteration
Input & Output
Subroutines
Command Details:
English Commands
Sandwich Commands
Regression Tests
When I wrote this, these were the messages (in alphabetical order) that could show up in the blank space below the counter when your program is running. More messages get added to the program as I make it better, and I try to keep this list up to date, but I don't always succeed. For each message, I tried to tell you why it happens, and (usually) what you can do to get past it. If you can't get past it, you might need to get help from the instructor.
(<cmd> is under construction)
What can I say? The Kitchen computer is a bigger project than I had time to finish. Usually there is another way to say the same thing that the Kitchen computer understands. If you don't know what that is, get help from the instructor.Assume <if> Not(...) Exit
Telling the computer "if <something> do next iteration" is kind of meaningless at or near the end of the loop, because the default is to do the next iteration. So the computer will try to assume that you really meant to sayAssume get <spread> on knifeif <something> is not true then exit the iterationwhich probably has your intended effect.
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 Next for open repeat
If you start a repeat (iteration), and you indent the lines you want repeated, and if you didn't put a Next command at the end of that indentation, it assumes you meant to do that and inserts it for you. If that wasn't what you iuntended, you might try making the indentation match your intended iteration.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).Assume repeat begins here
If you indented a portion of your program, and the indented part ends with something resembling a Next command, but there is no corresponding repeat command at the front of that indentation, the computer assumes that it should be there. But it's better if you put it in yourself.Assume repeat ends here
If you indented a portion of your program, and the indented part begins with something resembling a repeat command, but there is no corresponding Next command at the end of that indentation, the computer assumes that it should be there. But it's better if you put it in yourself.Assume Stop before end of program
The formal way to end a program is the Stop command. You can do this before the actual end of the program, but we assume it's probably a mistake, perhaps the result of accidentally terminating a subroutine with blank lines, so that the rest of the subroutine runs as main program, and its final Done command is what gave you this warning message.Assume subroutine ends here
The formal way to end a subroutine is with the Done command, but you can also do it with a blank line or just starting the next subroutine. This message is to let you know the subroutine ended. If that's not what you had in mind, you might put some kind of comment in your (otherwise) blank line. See "Subroutines" for more information.Assume subroutine <name> ended
The formal way to end a subroutine is with the Done command, but you can also do it with one or more blank lines. This message is to let you know the previous subroutine ended and you are now executing main program. If that's not what you had in mind, you might put some kind of comment in your (otherwise) blank line. See "Subroutines" for more information.Choose from list by 'item .. of var' or 'var[..]'
You can put items into a list using one of these forms:I can't <verb> <object> unless it's openput <value> into item <index> of <variable>You can get items out of a list using one of these forms:
put <value> into <variable> item <index>
let item <index> of <variable> be <value>
let <variable> item <index> be <value>
let <variable> [ <index> ] = <value>item <index> of <variable>You get this message if you omitted the <index> value or the left '[' or right bracket ']' or the word "item" or in some cases the word "of". You might also get it if you try to name a variable "item".
<variable> [ <index> ]
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 long to wait
The computer recognized that this is a wait command, but you did not say (clearly) how long.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 <time or date> it is
Something went wrong with this request, probably not your fault.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 color <object> is
Some objects obviously have a color, and the Kitchen computer knows what color they are. Others are plain, so Tom didn't tell the computer what color they are. I guess white is still a color, but we had to stop somewhere.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 below).I don't know what value <object> is
Some objects can have a numerical value, like how much cereal there is in the bowl, and the Kitchen computer knows what that value is. Most objects have no metric that can change value (apart from location), so if you ask for it in some way that implies you want a value, the computer complains.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 anything to <verb>
Tom's Kitchen computer knows how to eat a few things (like some cereal on a spoon), but some things you might know how to eat, the computer does not.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 a variable for <verb>
If you use one of the commands for giving a value to a variable, then obviously you need to give it a variable name. Variable names start with a letter and come immediately after the command name.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.I'm not ready for different dishes at the same time
Some things (like make a sandwich) the Kitchen computer does on a plate, and other things (like eat cereal) it does in a bowl, but it gets confused if you try to use both in the same program.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.Looks like missing 'let'
All commands, including putting a value into a variable, must begin with a command word. Most programming languages have other ways of knowing about assignments, so there's no command word there, but it doesn't read like real English -- in English "A = A+B" is nonsense, or else an equation that you can solve for B=0, but then why would you want to do that?Missing end of quotation
You probably forgot the end of a quoted text string, or maybe you used an apostrophe in a word that was not properly quoted and was not recognized as a comment. Quoted text can be surrounded by double quotes ("), double quotes ('), or grave accents (`). If you need one of those symbols in your quoted text, use a pair of the others to quote it. You can use the concatenation operator (#) to put different quotation fragments together.Next must be unconditional
Some other programming languages use the word "next" as a command like "exit" but to restart the iteration at the top, and if you have used those languages, you might be tempted to try it here. In Kitchen "Next" is more like a boundary, marking the end of what is to be repeated. The Kitchen compiler will try to turn a conditional
Please do things one at a timeif sometest then nextintoif not sometest then exitbut if it does not succeed, you get this message.
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 is no loop to do <more> here
You can restart an iteration before its next command in the Kitchen computer with a more command. You cannot go back to the front of a loop that is not currently active, so the more command only works inside an iteration.There is no <if> for the <otherwise>
An else or otherwise must always directly follow an if.There is no loop to do <more> here
Within an iteration you can jump back to the front from anywhere inside the iteration, but it makes no sense if you try to do this outside the iteration..There is no repeat for the <next>
An iteration in the Kitchen computer starts with a repeat command and ends with a next command. Sometimes the computer can figure out where the repeat belongs by your indentation, but apparently not this time. It works better if you are explicit about where your iteration begins and ends.There is nothing to <exit> here
The exit command drops you out of an iteration before the number of iterations has run out, or from somewhere in the loop other than the end. But it doesn't make any sense outside an iteration.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?
If you number your lines sequentially (there's a button to do that), then if you make a mistake that the computer can tell you about, the line numbers will match. Or you can leave the line numbers off, because the Kitchen computer ignores them. The Kitchen computer also ignores whether you capitalize your commands or not. When you get into Java you must be much more careful about those kinds of things.
The Kitchen computer knows how to make a peanut butter sandwich (with a few variations), and it knows how to prepare and eat a bowl of cereal. It's not much, but it gives you an idea how computer programs work, a sequence of steps done in order, operating on objects and values, where the steps may be repeated and/or based on testable conditions. You can also give a name to a part of your program, then call it up as a subroutine from other places in your program.
Generally, your programs should consist of a sequence of commands, one line each, where each command begins with a verb, what you want the Kitchen computer to do when it gets to that line. We recommend you number your lines, but it's not necessary.
Most commands tell the computer what to do to an object, which can be one of the common things you might find in a kitchen, but you can also do things with numbers and give names to values (variables). It is more limited than a real programming language, but it gets you started.
You can add comments (notes to yourself) in {curly braces, shift-[bracket] on most keyboards} (parentheses sometimes work as in some of the Preface example programs, but not on variable assignment lines).
Your best bet is to start with one of the Preface examples, then modify it to do what you want, or use it as an example to try something different.
The next two sections list the objects (nouns)
the Kitchen computer knows about, and the commands
(verbs) that it knows how to do to those things.
[left or right, dish or pantry] cabinet or cupboard or shelfThe Kitchen computer needs to be able to see what you are asking it to do something to, and if you can't see it on the screen, it probably can't see it either. Sometimes it will Assume to open something that needs opening, but other computers are not so smart, so you shouldn't get in the habit of letting it assume anything.
The dish cabinet is to the left, the pantry cabinet is to the right. If you don't specify which cabinet you want, the Kitchen computer will make a guess.refrigerator or fridge for things best kept cold
(silverware) drawer
counter
Normally you do not need to tell the Kitchen computer to put something on the counter, it assumes that's where something goes if you didn't say where.back or away
When you are finished with objects that came out of a cabinet or fridge or drawer, you can put it back.
Although the drawer appears to be full of silverware, the Kitchen computer
only knows about one knife, one spoon, and one fork.
You can get or take or remove an item from its location (which moves it to an available location on the counter), and you can get or take or remove some jam or PB from its jar [get is not yet working properly]. Milk and cereal should be poured. You can put a slice of bread on a plate, and you can spread jam or PB on it, then you can put (two slices) together or flip one slice over the other to finish your sandwich. You can dip or put the spoon into the bowl of cereal to get some cereal, then lift it into the air to eat it.
You can choose or see an object and then refer to it using it (until something else becomes it).
There is a message line below the Kitchen image, which reports program assumptions and problems the Kitchen computer cannot resolve on its own (see the list here). You can also put your own message on that line with the message (msg, print, say, show) command and a quoted string or defined variable with the text to display.
You can ask what [date or time] is it, and the result will be displayed on the message line, and also available in it. You can set the date or day of the week using it is [date], and then the date tests will use the new date.
Other commands are described in the following three sections.
Sequence -- (no link, these are just the lines of your English program), maybe Wait and Break count hereConditional -- If ... Then ... Otherwise
Input/Output -- Input or reading the time or date / Print or changing the pixels in the Kitchen image using one of the object commands like Open or Get or Spread
Variables -- Let plus some specialized operations like Round and Substring
Subroutines -- "Quoted Name" .. Done called by Do
Message "The sum of " # 1 # " plus " # 2 # " is " # 1+2You can put values (numbers or text) into named variables, but put can mean several different things (and the computer might guess wrong which you wanted), so the best way to do it is using the Let (or variable) command, like this:
Let myVar = 12The variable name is always a single word with only letters and digits (except it must begin with a letter). The value you put in a variable stays there until you put something else there, or your program ends. If this is too complicated, don't worry, we'll learn about variables in detail later, and more when we get to Java.
Variable calc = myVar*3+27 (=63 in calc)
The Kitchen computer needs to know that you intend for a word you are
using to be a variable. The best way is for you to define it in a Variable
command, but it can also figure it out when you use it in Let
or Input commands, but not inside a conditional.
When a variable has a number in it, you can round it to the
nearest whole number (integer) or truncate it towards zero (discard
the decimal part without rounding up):
Let myVar = 20/3 {=3.333..}
Round myVar {now = 3}
Let myVar = "abcdefgh"
Substring myVar,3,4 {leaves myVar = "defg"}
Substring front = myVar {front = "a" and myVar is unchanged}
List myVar = 3,".",1,4,1,5,9
Array theList
Let item 1 of theList = myVar[2]
Let theList[9] = 000
if myVar < calc message "less"After the value to be calculated, you should put a command to be executed if the result is true. You can put it on the same line or the next line. In this example, if myVar is equal to calc, the condition being tested (less) is false, so nothing is printed on the message line.
After a sequence of one or more conditionals using if, you can say else or otherwise to pick up the conditions the ifs missed:
if it is Tuesday take peach
if it is Thursday take grape jelly
otherwise take strawberry
The Kitchen computer is not smart enough to figure out that a set
of conditions ending in else all go together if some of those if-lines
call subroutines or even if they do repeats. When you need an else
or otherwise at the end of that kind of complex conditional, you
might use it to set variables you can test in a simpler fashion.
You can also test whether a bowl or spoon is empty and certain parts of the date or time, like what day (Sunday is 1, Monday is 2) or month or year it is, like
If it's Saturday choose the Strawberry jam
The Kitchen computer does not (at this time) know how to do more
than one command line in connection with an if-condition, but that
one command can be a repeat 1 (do it only once) and then everything
between the repeat and its final next happens only when the
condition is true:
if calc=3 repeat 1
msg "Do this first"
if myVar < calc exit
msg "then this, but not if myVar is less than 3"
msg "none of this happens if calc is not equal to 3"
next (done, the repeat is finished and so is the conditional)
msg "this happens immediately if the first condition is false"
Input uses the command input optionally followed by a variable
name that you want the input text or number to be loaded into (default
is it), and an optional number specifying how long input should
be limited to. If that number is negative, then the input value must be
a number (anything else the user types will be ignored). If you give it
a length 1, then the input must be a single letter, which is automatically
capitalized. Unless the user types in the whole maximum size, they need
to end their input with the Enter key. Or they can wait until it times
out, which is the same thing. The computer will flash instructions to the
user on the input line, including a warning when the timeout is approaching.
do part1This displays two messages, first "x=23" then "x=24".
part2
do part2 (again)"part1"
let x=23
done"part2"
msg "x=" # x
let x=x+1
done
We don't recommend it, but subroutine names can be multiple words, so
long as you don't use more than one space between them. You should avoid
using the same name for a subroutine that is significant in some other
part of your program (like command or variable names) because the subroutine
name will override any other usage (possibly resulting in an error the
Kitchen computer cannot guess a reasonable recovery from).
The command name (shown in bold) must be first on its line (after the line number, if any). Other required words are shown in monospace, or if optional, [inside brackets]. Descriptive terms in italic are used for parameters which might be any of several items of that kind.
Case (capitals or lower case) is not significant.
{S} Subroutines (start with quoted name, end with Done, called by Do)
{S} Sequence (implied by separate lines)
{C} Conditional
{R} Iteration (Repeat)
{I}/{O} Input/Output
{V} Variable
Input variable [sizetype] {I} | Repeat [count] {R} | If condition [then] {C} |
Print/Say/Display values {O} | Next {R} | Else/Otherwise {C} |
Let name [= value] {V} | Exit/Again {R} | Pause/Breakpoint |
Round/Truncate variable {V} | Wait seconds {O} | Substring/Character variable
[= source][, offset[, size]] {V} |
Do subroutineName {S} | "subroutineName" ... Done {S} |
Let/Variable/Box/Arrayname [= value] {V}
Purpose
To set a variable name to a particular value, possibly an arithmetic combination of several variables and/or numbers.Explanation
This can be used to declare a name to be a variable, and optionally to give it a value. Using the name in other commands that require a variable will also declare it, but not inside a conditional. The value can be an arbitrary expression of values (numbers, variables, quoted strings) connected by operators. Unlike more common languages, the keyword Let is required for assignments.Examples
Variable myVar {declares it to be a variable, but no value}
Let myVar = "Hello world!" {now has 12 characters}
Let aNum = 1+2 {=3}
Let myVar = aNum-5 # myVar {= "-2Hello world!"}
Let aNum = aNum / myVar {= -1.5 (ignores what is not a number)}
Array myVar = "one",2,aNum,"for" {four separate list items}
Let item 2 of myVar = myVar[4] { = "one","for",-1.5,"for"}
Print/Show/Say/Displayvalues
{O}
Purpose
To display text values in the output panel, or else on a single line under the Kitchen image.Explanation
This prints whatever value or values on a single line of output, shown on a separate output panel.Examples
Print "2+3=" 2+3 {shows: '2+3=5'}
{assume aNum as calculated above...}
Say "aNum = " # aNum {shows 'aNum = -1.5'}
If condition [then] command {C}Purpose
The Input command is used to get values into the computer that are not known when the program is written. These values are typed in on the keyboard by the user, and stored in the variable.Explanation
The interpreter waits for the user to type in some input (of the appropriate type, if specified) on a line by itself, and stores that value into the specified variable. It times out and accepts whatever has been typed so far after about 20 seconds of inactivity.If the sizetype is negative, the entered value must be a number (non-number characters will be ignored). If greater than zero, it specifies the number of characters that will be accepted (no EnterKey needed); a length exactly one also capitalizes any letter that comes. If omitted, there are no qualifications on the input.
Using a variable name in an Input command is sufficient to declare it as a variable.
Examples
Input aLine {gets any characters up to the Enter key or timeout}
Input aNum -1 {gets only a number}
Input max4 4 {gets 4 characters or less}
Input letter 1 {capitalizes a single letter, could be ""}
Purpose
This command is used to decide whether to do a command, based on a condition anticipated but not known when the program is written.Explanation
If the condition evaluates to true, the single command (either on the same line or -- better -- the following line) is executed. If it evaluates to false, the command is skipped. The only way to skip more than one command under the control of a single If-test is to enclose them inside a 'Repeat 1' command.[Work-Around] There are known problems with some commands on the same line as the conditional, particularly implied subroutine calls (without the command name Do) and any command other than Let when it includes an '=' symbol. It works fine on (two) separate lines.
Examples
Input letter 1
If letter < " " then Print "Nothing came"
if letter > 'Z' then Print "Not a letter" {see ASCII Chart}
if letter < "A" then print "could be a number or punctuation"
Otherwise Print "It's a letter!"
Purpose
This command specifies what command to do if none of the immediate preceding conditionals is true.Explanation
After a contiguous sequence of If-tests with no contained iterations or subroutine calls, if none of them evaluated true, then the command of the following Otherwise is executed.Example
{see IF-example above}
Repeat [count] {R}
commands
Next
Purpose
This pair of commands marks the beginning and end of code (commands) to be repeated some count number of times. They must both be in the same subroutine.Explanation
This is the basic iterator, to repeat any number of commands, which is between the Repeat and Next commands. If a count is specified, that is the number of times (possibly zero) the sequence of commands is executed. If no count is specified, 99 is assumed. If there is only one iteration in a program, and the commands (body) are indented, then the compiler may attempt to infer a missing Repeat or Next, but you shouldn't depend on that.Example
Let aNum = 0
Repeat 7
add 1 to aNum
if aNum>5.2 then Exit
if aNum=3 then Again
Print aNum {prints 1,2,4,5 on four separate lines}
Next
Purpose
Normally an iteration goes from start (the line after the Repeat command) to finish (the line before the Next command) the specified number of times, but these commands can bypass the ending and Exit out of the repeat or start over Again.Explanation
Used with a conditional inside an iteration, these commands can force an early termination (Exit) or jump to the next iteration (Again) of the nearest enclosing iteration. If no other Exit has been specified, the compiler will invert the controlling conditional and convert an Again at the end of an iteration into an Exit, but you shouldn't depend on that.Again only works on the same line as its controlling If (it doesn't make sense otherwise, just use Next).
Example
{see Repeat-example above}
" subroutineName" {S}
commands
Done
Purpose
These two lines define the beginning and end of a subroutine named subroutineNameExplanation
This is the basic subroutine form, starting with the name inside (double) quotation marks and ending with the word "Done" on its own line. Not recommended, but a blank line or the beginning of another subroutine also terminates the previous subroutine. Single spaces are permitted in subroutine names, but not recommended. See "Subroutines" above for more information.Example
Let X = 3 {main program code}"PrintX" {start subroutine}
print X {what this subroutine does}
Done {end of subroutine}Do PrintX {call the subroutine, X=3}
add 1 to X
Do PrintX {call it again, this time X=4}{this prints 3,4 on two separate lines}
Purpose
This is the preferred way to call a subroutine.Explanation
This command is the approved way to call a subroutine, but the subroutine name alone on a line also works. See "Subroutines" above for more information.Example
{see Subroutine-example above}
Purpose
The result of a divide or input operation could have a fractional part; this forces that result variable to be an integer.Explanation
The value in the variable is converted to a number, then rounded or truncated to an integer and put back into the variable. Rounding is IEEE-754 compliant, that is, if the variable is exactly halfway between two integers, the result is even; otherwise the result is whichever is closer. Note for example, that the IRS always rounds halfway up.Examples
Let rUp = 3.5
Let rDn = 2.5
Let closer = 3.49999
Let aNum = 3.9999
Round rUp {= 4}
Round rDn {= 2}
Round closer {= 3}
Truncate aNum {= 3}
Substring/Character variable
[= source] [, offset [, size]] {V}
Purpose
This extracts one or more characters from anywhere in a string (variable value).Explanation
This extracts a substring of characters from a source variable and stores the result into the specified destination variable (which will also be the source if not separately specified), beginning after offset characters (or zero if no offset is specified) for a length size (or a single character, if no size is specified. If the specified size is one, and it's a letter, it will be capitalized.[Work-around] If you need to use this command with the optional source variable under the control of a conditional, the '=' will probably be mistaken for a missing 'Let' command (error). It works OK if you split the line so the conditional is on the first line and the Substring or Character command is on the second line.
Examples
Let myVar = "Hello world!"
Let aNum = 3
Character letter = myVar,6 {gets "W"}
Substring myVar,aNum,aNum-1 {gets "lo"}
Purpose
This is a way to delay execution for a period of time (seconds).Explanation
This inserts a delay into the execution, mostly for visual timing.Examples
Wait 0.66 {wait 2/3 of a second before continuing}
Purpose
If you have a long-running program that is misbehaving, so that it is not convenient to Step through from the beginning to get to the place where you need to examine the program state (variables, call stack), you can set a breakpoint on a nearby line so it will pause there for examination.Explanation
This command causes the English IDE to pause on the next line and show the machine state (variable values and what subroutine calls got you here). Click the blue Step button to advance to the next line, or the green Fast button to resume at full speed, or the red STOP button to stop the program entirely so you can make changes to it (or else delete or add another breakpoint).Examples
Pause {break into the debugger when execution hits this line}
Close cabinet. | Get PB from pantry. | Open jelly. | Put loaf back. |
Close drawer. | Get piece of bread. | Open other cabinet. | Put PB back. |
Close jam. | Get plate from cupboard. | Open pantry cabinet. | Get another piece of bread. |
Close loaf. | If T/F then | Otherwise | Repeat num ... Next |
Close peanut butter. | It is date | Open peanut butter. | Spread jam on bread. |
Get bread from pantry. | Open bread. | Put bread pieces together. | Spread jelly on bread. |
Get jam from pantry. | Open cabinet. | Put it on plate. | Spread PB on bread. |
Get jelly from pantry. | Open drawer. | Put jam back. | |
Get knife from drawer. | Open jam. | Put jelly back. |
Close container
Open container
Container objects (cabinet/drawer/refrigerator/jam/PB/bread loaf/milk) can be closed (default, and for storage), or open for extracting contents. The contents cannot be extracted when the container is closed.
Get/Take object [fromcontainer]
This verb is used to extract an object from its container. It is not necessary to specify the container unless the container is closed (opening it will be assumed), and that only works for long-term storage containers like cabinet/drawer/refrigerator.
An object that came out of a container (cabinet/drawer/refrigerator) can be returned to its storage location using this command. The destination word away or back is required to distinguish this command from putting a value into a variable.
This command spreads some of the specified spreadable condiment (peanut butter/jam/flavor) on whatever slice of bread is available to take it.
[2022 October 5]