Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 31 lines (21 sloc) 0.728 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
import random
from randevents import locations_list, run_choices

# The kitty
class cat(object):

    def __init__(self):
        self.name = 'Kitty'

        # Randomly place the kitty in one of the rooms
        l = len(locations_list) - 1
        self.location = locations_list[random.randint(1,l)]

    def reveal(self):
        print '%s ran to the %s' % (self.name, self.location)

    def run(self):
        choices = run_choices[self.location]
        l = len(choices) - 1
        self.location = choices[random.randint(0,l)]

class player(object):
    def __init__(self):
        self.name = 'Player'
        self.location = 'foyer'

    def reveal(self):
        print '%s is in the %s' % (self.name, self.location)


Something went wrong with that request. Please try again.