from hlt import *
from networking import *

playerTag, gameMap = getInit()
sendInit("BasicBot"+str(playerTag))

turtleFactor = random.randint(1, 20)

while True:
	moves = []
	gameMap = getFrame()

	for y in range(0, len(gameMap.contents)):
		for x in range(0, len(gameMap.contents[y])):
			site = gameMap.contents[y][x]
			if site.owner == playerTag:
				direction = random.randint(0, 5)
				if site.strength < turtleFactor*site.production:
					direction = STILL
				else:
					for d in CARDINALS:
						if gameMap.getSite(Location(x, y), d).owner != playerTag:
							direction = d
							break
				moves.append(Move(Location(x, y), direction))

	sendFrame(moves)

from hlt import *
from networking import *

playerTag, gameMap = getInit()
sendInit("BasicBot"+str(playerTag))

while True:
	moves = []
	gameMap = getFrame()

	for y in range(0, len(gameMap.contents)):
		for x in range(0, len(gameMap.contents[y])):
			site = gameMap.contents[y][x]
			if site.owner == playerTag:
				direction = random.randint(0, 5)
				if site.strength < 5*site.production:
					direction = STILL
				else:
					for d in CARDINALS:
						if gameMap.getSite(Location(x, y), d).owner != playerTag:
							direction = d
							break
				moves.append(Move(Location(x, y), direction))

	sendFrame(moves)

Revert basic bot random turtle factor
Revert basic bot random turtle factor


Former-commit-id: 53ffe42cf718cfedaa3ec329b0688c093513683c
Former-commit-id: 6a282c036f4e11a0aa9e954f72050053059ac557
Former-commit-id: c52f52d401c4a3768c7d590fb02f3d08abd38002