Advertisement
Vermiculus

FARK ASHOK

Apr 9th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 23.86 KB | None | 0 0
  1. def d(m, s):
  2.     raw_input(m.format(s))
  3.  
  4. def statement_contains(s, l):
  5.     """Checks to see if s (a list of words) contains an element in l"""
  6.     ####### {v : v \in s AND v \in l} != {}
  7.     return [v for v in s if v in l] != []
  8.  
  9. class Kitchen:
  10.     """A facility for interpreting the esoteric language 'Chef'."""
  11.     class Error(Exception):
  12.         def __init__(self, title, message):
  13.             self.title = title
  14.             self.message = message
  15.    
  16.     def __init__(self, recipe="", master=None):
  17.         """Constructor
  18.        
  19.        Initializes lists for mixing bowls and baking dishes and
  20.            begins evaluating the recipe (taken in as a string).
  21.        """
  22.         import Bowl
  23.        
  24.         self.food = list()
  25.         with open('food.txt', 'r') as f:
  26.             for line in f:
  27.                 self.food.append(line[:-1])
  28.        
  29.         if master is None:
  30.             from collections import deque
  31.             self.ingredients = dict()    # contains a dictionary of ingredients
  32.             self.mixing_bowls = list()    # list of mixing bowls, stack-style
  33.             self.baking_dishes = list() # list of baking dishes, stack-style
  34.             self.stdin = deque()        # Our very own stdin! So we *could* take in more than one character at a time from what the user sees
  35.             self.stdout = deque()        # Well, if we have an stdin, might as well have an stdout. May make life easier.
  36.             self.history = list()        # Contains a list (stack) of (func, arg) tuples, most-recent last. Useful for looping.
  37.        
  38.         #handles a copy constructor
  39.         elif hasattr(master, 'ingredients') and hasattr(master, 'mixing_bowls') and hasattr(master, 'baking_dishes') and hasattr(master, 'stdin') and hasattr(master, 'stdout') and hasattr(master, 'history'):
  40.             self.ingredients = master.ingredients
  41.             self.mixing_bowls = master.mixing_bowls
  42.             self.baking_dishes = master.baking_dishes
  43.             self.stdin = master.stdin
  44.             self.stdout = master.stdout
  45.            
  46.             #self.history        = master.history
  47.             # This statement may interfere with correct looping.
  48.             #
  49.             # Note that how we are storing the history right now allows me to say things like this:
  50.             #
  51.             # >>> self.history.append(self.take, ['pizza', 'from', 'refrigerator'])
  52.             # >>> last_cmd = self.history[-1]
  53.             # (self.take, ['pizza', 'from', 'refrigerator'])
  54.             # >>> last_cmd[0](last_cmd[1])
  55.             # (does that last command again)
  56.  
  57.     def do(self, s):
  58.         """Does an arbitrary operation from a valid Chef string
  59.        
  60.        The command must be the first word, case sensitive.
  61.        If the command does not exist, None is returned.
  62.        The rest of the string is passed to the desired function as a list.
  63.        
  64.        Author: Sean
  65.        """
  66.        
  67.         def isVerbStatement(li):
  68.             return len(li) == 3 and li[1] == "the" and li[2] in [v + "." for v in self.ingredients]
  69.        
  70.         t = s.split()
  71.         try:
  72.             if s == "Ingredients.":
  73.                 self._do_ingredients()
  74.             elif len(t) < 2:
  75.                 raise Kitchen.Error("Syntax Error", "Commands must have at least two tokens.")
  76.             elif hasattr(self, t[0]):
  77.                 return getattr(self, t[0])(t[1:])
  78.             elif isVerbStatement(t): # the word may be a verb
  79.                 print "Verbing!"
  80.                 print "Verb:", t[0]
  81.             else:
  82.                 print "No such attribute"
  83.            
  84.         except Kitchen.Error as (title, message):
  85.             import sys
  86.             sys.excepthook(*sys.exc_info())
  87.            
  88.             print ""
  89.             print "{t}: {m}\a".format(t=title, m=message)
  90.             return False
  91.    
  92.     def _do_ingredients(self):
  93.         """Author: Sean"""
  94.         s = raw_input()
  95.         measures = {"ml":"wet", "l":"wet", "dash":"wet", "dashes":"wet", "g":"dry", "kg":"dry", "pinch":"dry", "pinches":"dry", "cup":None, "cups":None, "teaspoon":None, "teaspoons":None, "tablespoon":None, "tablespoons":None, None:None}
  96.         types = {"heaped":"dry", "level":"dry"}
  97.         while s != "":
  98.             s = self._get_ingredient(s, measures, types)
  99.             self.ingredients[s[0]] = (s[1], s[2])
  100.             s = raw_input()
  101.        
  102.     def __repr__(self):
  103.         """Author: Sean"""
  104.         return "  Ingridients: {ing}\n Mixing Bowls: {mb}\nBaking Dishes: {bd}\n Input Buffer: {ip}\nOutput Buffer: {op}".format(ing=str(self.ingredients), mb=str(self.mixing_bowls), bd=str(self.baking_dishes), ip=str(self.stdin), op=str(self.stdout))
  105.    
  106.     # Have this function declare a multidimensional array of strings according to differing degrees of messiness
  107.     # so it can be called
  108.     # ...    return arr[len(mixing_bowls) // 5][len(baking_dishes) // 5]
  109.     # or something like that.
  110.     def __str__(self):
  111.         """Author: Sean"""
  112.         return "You see a mess of utensils; you have a lot of work yet to do."
  113.    
  114.     def _get_bowl(self, s):
  115.         """Returns the mixing bowl specified by this string.
  116.        
  117.        This method searches the string provided for the mixing bowl needed:
  118.        >>> getDish("Pour the 3rd mixing bowl into the 2nd baking dish.")
  119.        3
  120.        
  121.        If no ordinal for a mixing bowl is specified, it defaults to 1:
  122.        >>> getDish("Put zucchinis into the mixing bowl.")
  123.        1
  124.        
  125.        If there is no mention of any mixing bowls, this function returns None:
  126.        >>> getDish("I've got poop for brains.")
  127.        None
  128.        
  129.        Author:
  130.        """
  131.         pass
  132.         return 0
  133.    
  134.     def _get_dish(self, s):
  135.         """Returns the baking dish specified by this string.
  136.        
  137.        This method searches the string provided for the baking dish needed:
  138.        >>> getDish("Pour the 3rd mixing bowl into the 2nd baking dish")
  139.        2
  140.        
  141.        If no ordinal for a baking dish is specified, it defaults to 1:
  142.        >>> getDish("Pour the 3rd mixing bowl into the baking dish")
  143.        1
  144.        
  145.        If there is no mention of any baking dishes, this function returns None:
  146.        >>> getDish("I've got poop for brains.")
  147.        None
  148.        
  149.         Author:
  150.        """
  151.         pass
  152.         return 0
  153.    
  154.     def _get_ingredient(self, item, measures, types):
  155.         """Takes exactly one string, a dictionary of valid measures, and a dictionary of valid measure-types and returns (name, value, type)
  156.        
  157.        Author: Sean
  158.        """
  159.         name = type = value = explicit_type = None
  160.         s = item.split()
  161.         if len(s) < 1:
  162.             raise Kitchen.Error("Ingredient Error", "Blank line encountered.")
  163.         if s[0].isdigit():
  164.             value = int(s[0])
  165.             if statement_contains(s[1:], measures):
  166.                 if s[1] in types:
  167.                     type = types[s[1]]
  168.                     name = s[2:]
  169.                 elif s[1] in measures:
  170.                     type = measures[s[1]]
  171.                     name = s[2:]
  172.                 else:
  173.                     raise Kitchen.Error("Ingredient Error", "Illegal value or ingredient encountered.")
  174.             else:
  175.                 name = s[1:]
  176.         elif s[0] in measures:
  177.             type = measures[s[0]]
  178.             name = s[1:]
  179.             if name == []:
  180.                 raise Kitchen.Error("Ingredient Error", "Must specifiy an ingredient name.")    
  181.             elif s[0] in types:
  182.                 if s[1] in measures:
  183.                     type = types[type]
  184.                     name = s[2:]
  185.                     if name == []:
  186.                         raise Kitchen.Error("Ingredient Error", "Must specifiy an ingredient name.")
  187.             else:
  188.                 raise Kitchen.Error("Ingredient Error", "Must specifiy measure for type.")
  189.         else:
  190.             name = s
  191.         name = ' '.join(name)
  192.         return (name, value, type)
  193.    
  194.     def _get_ingredients(self, l):
  195.         """Takes a list l of ingredient-statements and populates the ingredients.
  196.        
  197.        Author: Sean
  198.        """
  199.        
  200.         if len(l) < 1:
  201.             raise Kitchen.Error("Ingredient Error", "Must have at least one ingredient.")
  202.        
  203.         measures = {"ml":"wet", "l":"wet", "dash":"wet", "dashes":"wet", "g":"dry", "kg":"dry", "pinch":"dry", "pinches":"dry", "cup":None, "cups":None, "teaspoon":None, "teaspoons":None, "tablespoon":None, "tablespoons":None, None:None}
  204.         types = {"heaped":"dry", "level":"dry"}
  205.        
  206.         for item in l:
  207.             ing = self._get_ingredient(item, measures, types)
  208.             self.ingredients[ing[0]] = (ing[1], ing[2])
  209.  
  210.     bowl_index = None
  211.     dish_index = None
  212.     ingr_index = None
  213.     comd_index = None
  214.     auxc_index = None
  215.     def Take(self, s):
  216.         """Take (ingredient) from refrigerator.
  217.        
  218.        This reads a numeric value from STDIN into
  219.            the ingredient named, overwriting any
  220.            previous value.
  221.            
  222.        Author: Sean
  223.        """
  224.        
  225.         def isFood(s):
  226.             return not s.isdigit()
  227.        
  228.         ingredient_name = ' '.join(s[:-2])
  229.        
  230.         if not isFood(ingredient_name):
  231.             raise Kitchen.Error("Name Error", "You can't eat {}".format(ingredient_name))
  232.             return False
  233.         elif s[-1] != "refrigerator." or s[-2] != "from":
  234.             raise Kitchen.Error("Syntax Error", "Take <ingredient> from refrigerator.")
  235.             return False
  236.        
  237.         elif len(self.stdin) is 0:
  238.             _in = raw_input("Press enter after input: ")
  239.             if _in.isdigit(): # if the entire input can be parsed as a single number
  240.                 self.stdin.append(int(_in)) # append that number to the buffer
  241.                 self.ingredients[ingredient_name] = self.stdin.popleft()
  242.             else:
  243.                 for char in _in: # otherwise, append the integer value of each character entered to the buffer.
  244.                     self.stdin.append(ord(char))
  245.                 self.ingredients[ingredient_name] = self.stdin.popleft()
  246.        
  247.         else:
  248.             self.ingredients[ingredient_name] = self.stdin.popleft()
  249.        
  250.         self.history.append((self.take, s))
  251.        
  252.         return True
  253.    
  254.     def Put(self, s):
  255.         """Put (ingredient) into the [nth] mixing bowl.
  256.        
  257.        This puts the ingredient into the nth mixing bowl.
  258.        """
  259.         self.mixing_bowls.append(self.ingredients[s[ingr_index]])
  260.         return True
  261.    
  262.     def Fold(self, s):
  263.         """Fold (ingredient) into [nth] mixing bowl.
  264.        
  265.        This removes the top value from the nth mixing bowl and places it in the ingredient.
  266.        """
  267.         self.ingredients[s[ingr_index]] = self.mixing_bowls.pop()
  268.         return True
  269.    
  270.     def Add(self, s):
  271.         """Two uses.
  272.        
  273.        
  274.        Add (ingredient) [to [nth] mixing bowl].
  275.            This adds the value of ingredient to the
  276.            value of the ingredient on top of the
  277.            nth mixing bowl and stores the result
  278.            in the nth mixing bowl.
  279.        
  280.        Add dry ingredients [to [nth] mixing bowl].
  281.            This adds the values of all the dry ingredients
  282.            together and places the result into the
  283.            nth mixing bowl.
  284.        """
  285.         if s[auxc_index]:
  286.             self.mixing_bowls[s[bowl_index]].append(sum([ingr for ingr in self.ingredients if ingr[0] is 'dry']))
  287.         else:
  288.             self.mixing_bowls[s[bowl_index]][-1] += self.ingredients[s[ingr_index]]
  289.         return False
  290.    
  291.     def Remove(self, s):
  292.         """Remove ingredient [from [nth] mixing bowl].
  293.        
  294.        This subtracts the value of ingredient from
  295.            the value of the ingredient on top of the
  296.            nth mixing bowl and stores the result in
  297.            the nth mixing bowl.
  298.        """
  299.         self.mixing_bowls[s[bowl_index]][-1] -= self.ingredients[s[ingr_index]]
  300.         return True
  301.    
  302.     def Combine(self, s):
  303.         """Combine ingredient [into [nth] mixing bowl].
  304.        
  305.        This multiplies the value of ingredient by
  306.            the value of the ingredient on top of
  307.            the nth mixing bowl and stores the result
  308.            in the nth mixing bowl.
  309.        """
  310.         self.mixing_bowls[s[bowl_index]][-1] *= self.ingredients[s[ingr_index]]
  311.         return True
  312.    
  313.     def Divide(self, s):
  314.         """Divide ingredient [into [nth] mixing bowl].
  315.        
  316.        This divides the value of ingredient into
  317.            the value of the ingredient on top of
  318.            the nth mixing bowl and stores the result
  319.            in the nth mixing bowl.
  320.        """
  321.         self.mixing_bowls[s[bowl_index]][-1] /= self.ingredients[s[ingr_index]]
  322.         return False
  323.    
  324.     def Liquefy(self, s):
  325.         """Two uses.
  326.        
  327.        
  328.        Liquefy | Liquify ingredient.
  329.            This turns the ingredient into a liquid,
  330.            i.e. a Unicode character for output purposes.
  331.            
  332.            (Note: The original specification used
  333.            the word "Liquify", which is a spelling
  334.            error. "Liquify" is deprecated.
  335.            Use "Liquefy" in all new code.)
  336.        
  337.        Liquefy | Liquify contents of the [nth] mixing bowl.
  338.            This turns all the ingredients in the nth mixing bowl
  339.            into a liquid, i.e. a Unicode characters for
  340.            output purposes.
  341.        """
  342.         pass
  343.         return False
  344.    
  345.     def Stir(self, s):
  346.         """Two uses.
  347.        
  348.        
  349.        Stir [the [nth] mixing bowl] for number minutes.
  350.            This "rolls" the top number ingredients
  351.            in the nth mixing bowl, such that the
  352.            top ingredient goes down that number of
  353.            ingredients and all ingredients above it
  354.            rise one place. If there are not that many
  355.            ingredients in the bowl, the top ingredient
  356.            goes to tbe bottom of the bowl and all
  357.            the others rise one place.
  358.        
  359.        Stir ingredient into the [nth] mixing bowl.
  360.            This rolls the number of ingredients
  361.            in the nth mixing bowl equal to
  362.            the value of ingredient, such that
  363.            the top ingredient goes down that number
  364.            of ingredients and all ingredients above
  365.            it rise one place. If there are not that
  366.            many ingredients in the bowl, the top
  367.            ingredient goes to tbe bottom of the bowl
  368.            and all the others rise one place.
  369.        """
  370.         pass
  371.         return False
  372.    
  373.     def Mix(self, s):
  374.         """Mix [the [nth] mixing bowl] well.
  375.        
  376.        This randomises the order of the
  377.            ingredients in the nth mixing bowl.
  378.        """
  379.         import random
  380.         random.shuffle(self.mixing_bowls[s[bowl_index]])
  381.         return True
  382.    
  383.     def Clean(self, s):
  384.         """Clean [nth] mixing bowl.
  385.        
  386.        This removes all the ingredients
  387.            from the nth mixing bowl.
  388.        
  389.        Author: Sean
  390.        """
  391.         if len(s) > 3 or s[1] != 'mixing' or s[2] != 'bowl.':
  392.             return False
  393.        
  394.         num = self._get_dish(' '.join(s))
  395.         if num == None:
  396.             return False
  397.        
  398.         self.mixing_bowls[num] = list()
  399.         return True
  400.    
  401.     def Pour(self, s):
  402.         """Pour contents of the [nth] mixing bowl into the [pth] baking dish.
  403.        
  404.        This copies all the ingredients from
  405.            the nth mixing bowl to the
  406.            pth baking dish, retaining the order
  407.            and putting them on top of anything
  408.            already in the baking dish.
  409.        """
  410.         self.baking_dishes[s[dish_index]].extend(self.mixing_bowls[s[bowl_index]])
  411.         return True
  412.    
  413.     def Set(self, s):
  414.         """Set aside.
  415.        
  416.        This causes execution of the innermost
  417.            loop in which it occurs to end
  418.            immediately and execution
  419.            to continue at the statement after
  420.            the "until".
  421.        """
  422.         pass
  423.         return False
  424.    
  425.     def Serve(self, s):
  426.         """Two uses.
  427.        
  428.        
  429.        Serve with auxiliary-recipe.
  430.            This invokes a sous-chef to immediately
  431.            prepare the named auxiliary-recipe.
  432.            The calling chef waits until the sous-chef
  433.            is finished before continuing.
  434.            
  435.            See the section on auxiliary recipes below.
  436.        
  437.        Serves number-of-diners.
  438.            This statement writes to STDOUT the contents
  439.            of the first number-of-diners baking dishes.
  440.            It begins with the 1st baking dish,
  441.            removing values from the top one by one and
  442.            printing them until the dish is empty,
  443.            then progresses to the next dish, until all
  444.            the dishes have been printed.
  445.            
  446.            The serves statement is optional, but is
  447.            required if the recipe is to output anything!
  448.        """
  449.         for dish in self.baking_dishes:
  450.             while dish:
  451.                 self.stdout.append(dish.pop())
  452.         return False
  453.    
  454.     def Refrigerate(self, s):
  455.         """Refrigerate [for number hours].
  456.        
  457.        This causes execution of the recipe
  458.            in which it appears to end immediately.
  459.            If in an auxiliary recipe, the auxiliary
  460.            recipe ends and the sous-chef's first
  461.            mixing bowl is passed back to the calling
  462.            chef as normal. If a number of hours is
  463.            specified, the recipe will print out its
  464.            first number baking dishes before ending.
  465.        """
  466.         pass
  467.         return False
  468.    
  469.     def _verb_(self, s):
  470.         """Takes care of VERB until VERBED.
  471.        Not a clue on how to do this yet.
  472.        
  473.        IDEA!
  474.         -- Create a new kitchen
  475.         -- keep reading in commands until verbed
  476.         -- pass commands to a new kitchen
  477.         -- once we reach 'until verbed', execute the history again
  478.         -- keep executing until condition is zero
  479.        """
  480.  
  481.         pass
  482.  
  483. def read_recipe(filepath):
  484.     """Loads the given *.chef file and does initial parsing.
  485.    
  486. This method will parse the given filename
  487.  
  488. See http://docs.python.org/library/doctest.html#module-doctest
  489. So much awesome.
  490.  
  491. Example output:
  492. >>> print read_recipe("/hw.chef")
  493. ["Hello World Souffle", "This recipe prints the immortal words "Hello world!", in a basically brute force way. It also makes a lot of food for one person.", "72 g haricot beans
  494. 101 eggs
  495. 108 g lard
  496. 111 cups oil
  497. 32 zucchinis
  498. 119 ml water
  499. 114 g red salmon
  500. 100 g dijon mustard
  501. 33 potatoes", "Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. Put lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into the mixing bowl. Put water into the mixing bowl. Put zucchinis into the mixing bowl. Put oil into the mixing bowl. Put lard into the mixing bowl. Put lard into the mixing bowl. Put eggs into the mixing bowl. Put haricot beans into the mixing bowl. Liquefy contents of the mixing bowl. Pour contents of the mixing bowl into the baking dish.
  502.  
  503. Serves 1."]
  504.    """
  505.     pass
  506.  
  507. # takes the instruction string from earlier and splits it into statements
  508. def preheat(method):
  509.     """Takes all of the statements (as a single string) under Method and begins the parsing process.
  510.    
  511. This method returns a list of simple tuples where the first element is the command
  512. and the second element is the source string. The output of this method is intended
  513. for calling Mom.
  514.    """
  515.     pass
  516.  
  517. def gather(ingredients):
  518.     """Return a dictionary of ingredients from the given string.
  519.    
  520. The dictionary returned will contain the ingredient as a string
  521. mapped to a tuple, where the first element indicates if it is dry or wet
  522. and the second element denotes its numeric value.
  523.  
  524. Example:
  525.    {'apple':('dry', 96), 'oil':('wet', 59), etc.}
  526.    """
  527.     pass
  528.  
  529. # Because we all know her handwriting is horrid.
  530. # we may be able to make this fun by using advanced features of functions in Python
  531. def callMom(method):
  532.     """Takes a list of command-string tuples and returns a list of pure command-tuples.
  533.    
  534. Following is a list of commands and descriptions, following the pattern
  535. (<command>,     <arguments>)    - execute <command> with <arguments>
  536. where the default value of ## is exactly 1 (signifying the mixing bowl index
  537. and where # is a plain number
  538.  
  539. For overloaded commands, use hasattr() for type checking
  540.  
  541. ('take',     'ingredient')                   - get one character from the user and place its numeric value into ingredient
  542. ('put',         'ingredient', ##)               - push the ingredient onto the ##th mixing bowl
  543. ('fold',     'ingredient', ##)               - pop the ##th mixing bowl into the ingredient
  544. ('add',         'ingredient', ##)               - peek at the ##th mixing bowl and add (numerically) ingredient to it
  545. ('remove',     'ingredient', ##)               - peek at the ##th mixing bowl and subtract (numerically) ingredient from it
  546. ('combine',     'ingredient', ##)               - peek at the ##th mixing bowl and multiply (numerically) ingredient with it
  547. ('divide',     'ingredient', ##)               - peek at the ##th mixing bowl and divide (numerically) ingredient from it
  548. ('add', ##)                                   - takes all of the dry ingredients and places the sum into the #th mixing bowl
  549. ('liquefy',     'ingredient')                   - transform the ingredient into its Unicode equivalent
  550. ('liquefy',      ##)                           - transform the contents of the ##th mixing bowl into their Unicode equivalents
  551. ('stir',      ##,            #)               -
  552. ('stir',     'ingredient',    ##)               -
  553. ('mix',           ##)                           - randomize the order of the ##th mixing bowl
  554. ('clean',       ##)                           - pop the ##th mixing bowl until empty
  555. ('loop',      'verb',       'ingredient')   - See after.
  556. ('next',      'verb',       'ingredient')   - See after.
  557. ('exit')                                   - Continues execution after the next 'next'
  558. ('serve',      'recipe')                       - Invokes the execution of another recipe
  559. ('fridge')                                   - Ends execution immediately and returns the first mixing bowl
  560. ('fridge, #)                               - Print out the first # baking dishes before calling ('fridge')
  561.  
  562. ('serves', #)                               - Pops and prints each baking dish in succession. This is the last command.
  563.  
  564. Note that everything that follows the 'serve' command is an auxiliary recipe.
  565.  
  566. Looping:
  567.   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'.
  568.   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.
  569.  
  570. The output of this method is intended for cooking.
  571.    """
  572.    
  573.     pass
  574.  
  575. def loadVerbs(path):
  576.     """Return a list verbs and their past-tense form read from a file with the given path.
  577.        
  578. The return will be a list of tuples containing two strings:
  579. the first being the infinite stem, the second being the simple past.
  580.  
  581. Example:
  582.    [("sift","sifted"),("boil","boiled"), ...]
  583.    """
  584.     pass
  585.  
  586. def loadFoods(path):
  587.     """ Returns a simple list of foods read from a file with the given path."""
  588.     pass
  589.  
  590. # executes a list of commands
  591. def cook(ingredients, method):
  592.     """Execute the list of commands given using the ingredients provided.
  593.    
  594. Execute the given list of commands in the format given by calling Mom.
  595. It is an error if a given command does not exist.
  596.    """
  597.    
  598.     ###################################################
  599.    
  600.     # iterate through the commands with complete control over position
  601.     #    (python's for-each loop does not give you any control)
  602.     cmd_index = 0
  603.     while cmd_index < len(method):
  604.         cmd_index += 1
  605.         pass
  606.    
  607.     pass
  608.  
  609.  
  610. ########################################
  611.  
  612. c = Cookbook()
  613. print c.test("Put zuchinni into mixing bowl")
  614.  
  615. # print statement_contains("hello world".split(), ["hello", "poop"])
  616. #
  617. # hat = 'c= '
  618. #
  619. # kills = ["quit", "exit", "stop", "kill", "term"]
  620. #
  621. # k = Kitchen()
  622. #
  623. # cmd = raw_input(hat)
  624. # while cmd[:4] not in kills: # checks the first four letters
  625. #     k.do(cmd)
  626. #     print repr(k)
  627. #     cmd = raw_input(hat)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement