diff options
author | Peter Ward <peteraward@gmail.com> | 2014-07-26 13:08:27 +1000 |
---|---|---|
committer | Peter Ward <peteraward@gmail.com> | 2014-07-26 13:08:27 +1000 |
commit | 85b84bf04b654b7075f821536dcd25b85aa9cea4 (patch) | |
tree | 20709183bc4266165f247d0d68a0a22ae3b1e8b5 | |
parent | c3d7c3c8546ad0176b6c7766b45749383902e1ca (diff) | |
parent | 58e37a1be5b257def98b5c86de84c068e21512df (diff) |
merged
-rw-r--r-- | robots/__init__.py | 1 | ||||
-rw-r--r-- | setup.py | 7 | ||||
-rw-r--r-- | simple.py | 16 |
3 files changed, 10 insertions, 14 deletions
diff --git a/robots/__init__.py b/robots/__init__.py index f47e080..4406736 100644 --- a/robots/__init__.py +++ b/robots/__init__.py @@ -1,3 +1,4 @@ from robots.cursesviewer import CursesViewer from robots.game import Game +from robots.server import Server from robots.utils import empty_map, border_map @@ -4,5 +4,10 @@ from Cython.Build import cythonize setup( name='robots', packages=find_packages(), - ext_modules = cythonize('robots/*.pyx') + ext_modules=cythonize('robots/*.pyx'), + install_requires=[ + 'flask', + 'blessings', + 'cython', + ], ) @@ -1,7 +1,6 @@ import random import robots -from robots.utils import add_spawns def random_walk(whoami, state): my_robots = state.robots_by_player[whoami] @@ -11,15 +10,6 @@ def random_walk(whoami, state): ) if __name__ == '__main__': -# random.seed(42) - map_ = robots.border_map(20, 10, 0) - - add_spawns(map_, 10, 'X') - add_spawns(map_, 20, '+') - add_spawns(map_, 4) - - game = robots.Game(map_) - game.add_bot(random_walk, 'Alice') - game.add_bot(random_walk, 'Bob') - viewer = robots.CursesViewer(game) - viewer.run() + server = robots.Server() + server.add_simple_bot(random_walk, 'Alice') + server.run(debug=True) |