Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import hlt
  2. from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square
  3. import random
  4.  
  5.  
  6. myID, game_map = hlt.get_init()
  7. hlt.send_init("RandomPythonBot")
  8.  
  9. while True:
  10. game_map.get_frame()
  11. moves = [Move(square, random.choice((NORTH, EAST, SOUTH, WEST, STILL))) for square in game_map if square.owner == myID and square.strength > 0]
  12. hlt.send_frame(moves)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement