Commits

Peter Ward committed a372efd Merge

merged

  • Participants
  • Parent commits b469aa4, 74ac803

Comments (0)

Files changed (3)

robots/__init__.py

 from robots.cursesviewer import CursesViewer
 from robots.game import Game
+from robots.server import Server
 from robots.utils import empty_map, border_map
 setup(
     name='robots',
     packages=find_packages(),
-    ext_modules = cythonize('robots/*.pyx')
+    ext_modules=cythonize('robots/*.pyx'),
+    install_requires=[
+        'flask',
+        'blessings',
+        'cython',
+    ],
 )
 import random
 
 import robots
-from robots.utils import add_spawns
 
 def random_walk(whoami, state):
     my_robots = state.robots_by_player[whoami]
     )
 
 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)