aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2021-06-04 16:40:01 +0000
committerAnthony Wang2021-06-04 16:40:01 +0000
commit82f17266b91ae9fb943da77e927f5cd5e17eee6f (patch)
tree9a0ccbf74742187f061bed7d06a551a884242924
parent06c2b21845b70f663e80b7ffe3180f1ab06ee1bd (diff)
Implement stupid strategy
-rw-r--r--python-algo/algo_strategy.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python-algo/algo_strategy.py b/python-algo/algo_strategy.py
index 1767a3f..97457b5 100644
--- a/python-algo/algo_strategy.py
+++ b/python-algo/algo_strategy.py
@@ -53,7 +53,7 @@ class AlgoStrategy(gamelib.AlgoCore):
game engine.
"""
game_state = gamelib.GameState(self.config, turn_state)
- game_state.attempt_spawn(DEMOLISHER, [24, 10], 3)
+ # game_state.attempt_spawn(DEMOLISHER, [24, 10], 3)
gamelib.debug_write('Performing turn {} of your custom algo strategy'.format(game_state.turn_number))
game_state.suppress_warnings(True) #Comment or remove this line to enable warnings.
@@ -79,6 +79,10 @@ class AlgoStrategy(gamelib.AlgoCore):
# Now build reactive defenses based on where the enemy scored
self.build_reactive_defense(game_state)
+ if game_state.turn_number % 2 == 0:
+ game_state.attempt_spawn(SCOUT, [11, 2], game_state.number_affordable(SCOUT))
+
+ '''
# If the turn is less than 5, stall with interceptors and wait to see enemy's base
if game_state.turn_number < 5:
self.stall_with_interceptors(game_state)
@@ -101,6 +105,7 @@ class AlgoStrategy(gamelib.AlgoCore):
# Lastly, if we have spare SP, let's build some Factories to generate more resources
support_locations = [[13, 2], [14, 2], [13, 3], [14, 3]]
game_state.attempt_spawn(SUPPORT, support_locations)
+ '''
def build_defences(self, game_state):
"""
@@ -111,12 +116,12 @@ class AlgoStrategy(gamelib.AlgoCore):
# More community tools available at: https://terminal.c1games.com/rules#Download
# Place turrets that attack enemy units
- turret_locations = [[0, 13], [27, 13], [8, 11], [19, 11], [13, 11], [14, 11]]
+ turret_locations = [[0, 13], [2, 13], [4, 13], [6, 13], [8, 13], [10, 13], [12, 13], [15, 13], [17, 13], [21, 13], [23, 13], [25, 13], [27, 13]]
# attempt_spawn will try to spawn units if we have resources, and will check if a blocking unit is already there
game_state.attempt_spawn(TURRET, turret_locations)
# Place walls in front of turrets to soak up damage for them
- wall_locations = [[8, 12], [19, 12]]
+ wall_locations = [[1, 13], [3, 13], [5, 13], [7, 13], [9, 13], [11, 13], [13, 13], [14, 13], [16, 13], [18, 13], [20, 13], [22, 13], [24, 13], [26, 13]]
game_state.attempt_spawn(WALL, wall_locations)
# upgrade walls so they soak more damage
game_state.attempt_upgrade(wall_locations)