Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/just-cameron/misc-python. All my Python code for class or other things.
Something went wrong. Try again.
1234567891011121314151617181920import hltfrom hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Squareimport random
myID, game_map = hlt.get_init()hlt.send_init("Stronghold")
def assign_move(square): if square.strength == 0: return Move(square, STILL) for direction, neighbor in enumerate(game_map.neighbors(square)): if square.strength >= 150 and neighbor.strength < square.strength: return Move(square, direction)
while True: game_map.get_frame() moves = [assign_move(square) for square in game_map if square.owner == myID] hlt.send_frame(moves)