summaryrefslogtreecommitdiff
path: root/common.py
diff options
context:
space:
mode:
authorPeter Ward <peteraward@gmail.com>2009-09-28 11:29:57 +1000
committerPeter Ward <peteraward@gmail.com>2009-09-28 11:29:57 +1000
commitb781dfc5059f22d273916df88d9aef2f176358ab (patch)
treee59a31f6b8efb7986a8f76b1d42adeed3c5dba3a /common.py
parent47c02c2e6392cb1c9868062b15f4a8c1b3ed1505 (diff)
Made directions public, added bounds checking.
Diffstat (limited to 'common.py')
-rw-r--r--common.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/common.py b/common.py
index 7ccf8e9..50b8eb0 100644
--- a/common.py
+++ b/common.py
@@ -1,5 +1,12 @@
import os
+directions = {
+ 'U': (0, -1),
+ 'D': (0, 1),
+ 'L': (-1, 0),
+ 'R': (1, 0),
+}
+
class Squares(object):
EMPTY = '.'
APPLE = '*'