Exemplo n.º 1
0
class StoryTeller:
    """Forms short stories with given files, and returns a string with it."""
    def __init__(self):
        self.people = DiskList("people.txt")
        self.actions = DiskList("actions.txt")
        self.places = DiskList("places.txt")

    def random_fable(self):
        """Forms a random short story with the fable formula, returning a String with it."""
        #whata... x.x
        pair = self.people.random_pair()
        return "You are going to " +self.actions.random_item()+ " in order to kill " + pair[0] + " and then finally save your beloved " +pair[1]+ " and live forever happy together..."

    def random_love_tragedy(self):
        """Forms a random short story with the Romeo and Juliet formula, returning a String with it."""
        pair = self.people.random_pair()
        act = self.actions.random_item()
        plc = self.places.random_item()
        return pair[0]+ " and " +pair[1]+ " loved each other, but their famylies hated each other, beacuse of that " +pair[0]+ ", "+act+" "+plc+", discovering this, "+pair[1]+" kills self, but actually "+pair[0]+",do NOT done that thing i said, and finds "+pair[1]+" dead, seeing that "+pair[0]+" kills self too."

    def random_future(self):
        """Forms a very short story telling the future."""
        who = self.people.random_item()
        act = self.actions.random_item()
        plc = self.places.random_item()
        return who +" will "+ act +" "+plc