Implement yummy-toast?. Toast is yummy when
it’s white bread toasted to a level between 6 and 8 inclusive.
Implement toast-more, which takes some toast and makes
it more toasted, if possible.
Choose a representation for bagels:
whether the bagel is sliced
whether the bagel has cream cheese
toastedness, on a scale of 0 to 10
Implement yummy-bagel? (specified however you like—examples should clarify).
Define the datatype for bread, which is toast or bagel.
Implement yummy-bread?.
Choose a representation for toasters:
bread in the toaster
whether the toast/lever is 'down (on) or up (off)
Implement should-turn-on-toaster?. Don’t turn on the toaster
if it’s already on, or if the bread is a bagel has cream cheese or isn’t sliced, or if the bread is toasted
more than level 6 already. The implementation will involve new functions on bread, etc.
Implement maybe-turn-on-toaster, which turns on the toaster if it should.
Define a datatype for a jelly sandwich, which combines two pieces of bread
with jelly. Implement
yummy-samdwhich?, which determines whether a sandwhich is made with
two pieces of yummy bread.
Last update: Wednesday, October 20th, 2010mflatt@cs.utah.edu