summaryrefslogtreecommitdiff
path: root/bots.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 /bots.py
parent47c02c2e6392cb1c9868062b15f4a8c1b3ed1505 (diff)
Made directions public, added bounds checking.
Diffstat (limited to 'bots.py')
-rw-r--r--bots.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bots.py b/bots.py
index cf23602..dba440d 100644
--- a/bots.py
+++ b/bots.py
@@ -1,5 +1,8 @@
import random
+def right_bot(board, (x, y)):
+ return 'R'
+
def random_bot(board, (x, y)):
height = len(board)
width = len(board[0])
@@ -14,3 +17,7 @@ def random_bot(board, (x, y)):
moves.append('D')
return random.choice(moves)
+def random_bot2(board, (x, y)):
+ move = random_bot(board, (x, y))
+ nx, ny = x
+