Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #mixing_bowls = list(list())
- # loads the CHEF file and parses it into tokens
- # [<title>,<ingredient_string>,<instructions_string>]
- def readRecipe(filepath):
- pass
- # takes the instruction string from earlier and splits it into statements
- def preheat(instructions):
- pass
- # returns a dictionary of ingredients from a string
- # ['apple':('dry',96), 'oil':('wet', 59), etc.]
- def gather(ingredients):
- pass
- # Because we all know her handwriting is horrid.
- # takes a list of strings and returns a list of command-tuples
- # Following is a list of commands and descriptions, following the pattern
- # (<command>, <arguments>) - execute <command> with <arguments>
- # where the default value of ## is exactly 1 (signifying the mixing bowl index
- # and where # is a plain number
- #
- # For overloaded commands, use hasattr() for type checking
- #
- # ('take', 'ingredient') - get one character from the user and place its numeric value into ingredient
- # ('put', 'ingredient', ##) - push the ingredient onto the ##th mixing bowl
- # ('fold', 'ingredient', ##) - pop the ##th mixing bowl into the ingredient
- # ('add', 'ingredient', ##) - peek at the ##th mixing bowl and add (numerically) ingredient to it
- # ('remove', 'ingredient', ##) - peek at the ##th mixing bowl and subtract (numerically) ingredient from it
- # ('combine', 'ingredient', ##) - peek at the ##th mixing bowl and multiply (numerically) ingredient with it
- # ('divide', 'ingredient', ##) - peek at the ##th mixing bowl and divide (numerically) ingredient from it
- # ('add', ##) - takes all of the dry ingredients and places the sum into the #th mixing bowl
- # ('liquefy', 'ingredient') - transform the ingredient into its Unicode equivalent
- # ('liquefy', ##) - transform the contents of the ##th mixing bowl into their Unicode equivalents
- # ('stir', ##, #) -
- # ('stir', 'ingredient', ##) -
- # ('mix', ##) - randomize the order of the ##th mixing bowl
- # ('clean', ##) - pop the ##th mixing bowl until empty
- # ('loop', 'verb', 'ingredient') - See after.
- # ('next', 'verb', 'ingredient') - See after.
- # ('exit') - Continues execution after the next 'next'
- # ('serve', 'recipe') - Invokes the execution of another recipe
- # ('fridge') - Ends execution immediately and returns the first mixing bowl
- # ('fridge, #) - Print out the first # baking dishes before calling ('fridge')
- #
- # ('serves', #) - Pops and prints each baking dish in succession. This is the last command.
- #
- # Looping:
- # With the 'loop' command, if the ingredient is non-zero, continue execution until reaching the 'next' command. If the ingredient is zero, continue execution after a matching 'next'.
- # At the 'next' command, if an ingredient is given (defaulting to the ingredient given by 'loop'), continue execution at the previous 'loop' if the given ingredient is non-zero. If the ingredient is zero, simply continue.
- # we may be able to make this fun by using list unpacking and functions
- def callMom(instructions):
- pass
- # executes a list of commands
- def cook(commands):
- # returns a list of verbs loaded from a file (path)
- # [("sift","sifted"),("boil","boiled"), ...]
- def loadVerbs(path):
- pass
- # returns a list of foods loaded from a file (path)
- def loadFoods(path):
- pass
- ###################################################
- # iterate through the commands with complete control over position
- # (python's for-each loop does not give you any control)
- cmd_index = 0
- while cmd_index < len(command):
- cmd_index += 1
- pass
- pass
- print [None,[]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement