diff options
Diffstat (limited to 'robots/constants.py')
| -rw-r--r-- | robots/constants.py | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/robots/constants.py b/robots/constants.py new file mode 100644 index 0000000..4c36cce --- /dev/null +++ b/robots/constants.py @@ -0,0 +1,45 @@ +DIRECTIONS = { +    'U': (0, -1), +    'D': (0, 1), +    'L': (-1, 0), +    'R': (1, 0), +} + +class City: +    NORMAL = '.' +    GHOST = 'X' +    FACTORY = '+' + +    # Cities which can pledge allegiance. +    # Allegiable is totally a real word. +    # No, really, it is. +    # Why doesn't anyone believe me?!! +    # /sobs +    allegiable = (NORMAL, FACTORY) + +    # Cities which robots can move into. +    traversable = (NORMAL, FACTORY) + +class Action: +    UP = 'U' +    DOWN = 'D' +    LEFT = 'L' +    RIGHT = 'R' +    PROMOTE = 'P' +    NOTHING = '-' + +    all = (UP, DOWN, LEFT, RIGHT, PROMOTE, NOTHING) + +class Energy: +    INITIAL = 6 +    MAXIMUM = 9 +    GAIN = 2 + +ENERGY_BY_ACTION = { +    Action.UP: 3, +    Action.DOWN: 3, +    Action.LEFT: 3, +    Action.RIGHT: 3, +    Action.PROMOTE: 4, +    Action.NOTHING: 0, +}  | 
