repl.it
@jdelarios/

constants.py

Pygame

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
import re

class Directions(object):
    NORTH = re.compile('(?:^\s*n\s*$|.*north\s*$)', re.IGNORECASE)
    SOUTH = re.compile('(?:^\s*s\s*$|.*south\s*$)', re.IGNORECASE)
    EAST = re.compile('(?:^\s*e\s*$|.*east\s*$)',   re.IGNORECASE)
    WEST = re.compile('(?:^\s*w\s*$|.*west\s*$)',   re.IGNORECASE)

class Commands(object):
    TAKE = re.compile('^\s*(?:take)\s+(.*)',      re.IGNORECASE)
    DROP = re.compile('^\s*(?:drop)\s+(.*)',      re.IGNORECASE)
    INVENTORY = re.compile('(?:^i$|.*inventory)', re.IGNORECASE)
    HELP = re.compile('(?:^h$|.*help\.*)',        re.IGNORECASE)