# Written By: Arup Guha
# Translated By: Tyler Woodhull
# 6/1/2013
# MagicEightBall.py

from random import randint

class MagicEightBall:

    response1 = ""
    response2 = ""
    response3 = ""

    # Build our object to set each of our responses.
    def __init__(self, s1 = "YES", s2 = "NO", s3 = "MAYBE"):
        self.response1 = s1
        self.response2 = s2
        self.response3 = s3

    # Returns one of the possible responses via random choice.
    def getResponse(self):
        # Choose a random number (0,1,2)
        choice = randint(0, 2)

        # Return the appropriate choice.
        if (choice == 0):
            return self.response1
        elif (choice == 1):
            return self.response2

        return self.response3

def main():
    # Get the information to create the eight ball
    line = input("Please enter the three responses for your magic eight ball\n")

    # Turns input into a list, separated at each space
    answers = line.split()
    
    s1 = answers[0]
    s2 = answers[1]
    s3 = answers[2]

    mine = MagicEightBall(s1, s2, s3)

    # Run till the user doesn't have a question.
    while (True):
        # Read in their question and print the response.
        question = input("What is your question?\n")

        print(mine.getResponse())

        response = input("Would you like to ask a question?\n")

        # Get out since they have ne more questions
        if (response != "yes"):
            break
            
main()
