Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def do_turn(pw):
- ships = 0
- if len(pw.my_fleets()) >= 1:
- return
- if len(pw.my_planets()) == 0:
- return
- if len(pw.neutral_planets()) >= 1:
- num = int(random.random() * len(pw.neutral_planets()))
- dest = pw.neutral_planets()[0]
- else:
- if len(pw.enemy_planets()) >= 1:
- num = int(random.random() * len(pw.enemy_planets()))
- dest = pw.enemy_planets()[0]
- for i in pw.my_planets:
- if(pw.my_planets()[i].num_ships > ships):
- ships = i
- source = pw.my_planets()[ships]
- num_ships = source.num_ships() + 1
- pw.debug('Num Ships: ' + str(num_ships))
- pw.issue_order(source, dest, num_ships)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement