summaryrefslogtreecommitdiff
path: root/console_snake.py
diff options
context:
space:
mode:
authorPeter Ward <pwar3236@usyd.edu.au>2010-01-05 07:07:10 +1100
committerPeter Ward <pwar3236@usyd.edu.au>2010-01-05 07:07:10 +1100
commit2ee7eaba813ffaca6a3715d8bc7cf25d854af835 (patch)
tree75c65ec409daa2be620baf96084c8fa46c8bef36 /console_snake.py
parentf788bdcf63d14dd97f0802391b0676ca84c900ce (diff)
Gave common arg formatting.
Diffstat (limited to 'console_snake.py')
-rwxr-xr-xconsole_snake.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/console_snake.py b/console_snake.py
index 3c40b24..1db5e38 100755
--- a/console_snake.py
+++ b/console_snake.py
@@ -58,15 +58,14 @@ class ConsoleSnakeEngine(SnakeEngine):
self.update_snakes()
def main(*args):
- from bots import *
+ import sys
from processbot import BotWrapper
- game = ConsoleSnakeEngine(25, 25, 50)
- game.add_bot(right_bot)
- game.add_bot(random_bot)
- game.add_bot(random_bounds_bot)
- game.add_bot(random_square_bot)
- game.add_bot(BotWrapper('bots/peter.py'))
+ rows, columns, apples = map(int, sys.argv[1:4])
+ game = ConsoleSnakeEngine(rows, columns, apples)
+ for filename in sys.argv[4:]:
+ bot = BotWrapper(filename)
+ game.add_bot(bot)
game.run()
if __name__ == '__main__':