Commits

makestory  committed f756bbf

fix code paste error

  • Participants
  • Parent commits b3ec607

Comments (0)

Files changed (2)

File examples/makestory/kojiro.py

         snake.cmd_think()
         snake.cmd_turn()
         print DIRECTION_HASH[(snake.next - snake.prev)%4]
+
+    print "Total Round %s" % snake.info['round']
+    print "Score:"
+    for s in snake.info['snakes']:
+        print " %s,[%s]: %s} " % (s['name'],('alive' if s['alive'] else 'dead'),len(s['body']))
     
 if __name__=="__main__":
     main()
-
-
-    while snake.info['status'] == 'running':
-        snake.think()
-        snake.turn()
-    
-if __name__=="__main__":
-    main()
-
-

File rubyweb/server.rb

+require 'rubygems'
 require "json"
 require 'zmq'
 require "sinatra"