From b781dfc5059f22d273916df88d9aef2f176358ab Mon Sep 17 00:00:00 2001 From: Peter Ward Date: Mon, 28 Sep 2009 11:29:57 +1000 Subject: Made directions public, added bounds checking. --- bots.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bots.py') 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 + -- cgit v1.2.3