Skip to content

Instantly share code, notes, and snippets.

View Plutoberth's full-sized avatar

Nir Plutoberth

View GitHub Profile
def do_turn(pw):
# (1) If we currently have a fleet in flight, just do nothing.
if len(pw.MyFleets()) >= 1:
return
# (2) Find my strongest planet.
source = -1
source_score = -999999.0
source_num_ships = 0
my_planets = pw.MyPlanets()
for p in my_planets:
def do_turn(pw):
if len(pw.my_fleets()) >= 1:
return
source = -1
source_score = -999999.0
source_num_ships = 0
my_planets = pw.my_planets()
for p in my_planets:
score = float(p.num_ships())
if score > source_score: