Skip to content

Commit

Permalink
Reorder captures taking into account the bonus
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoding committed Jan 17, 2014
1 parent f1f9c27 commit 162ea71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ Strategies:

Move armies to other region if it needs it
- http://theaigames.com/competitions/conquest/games/52d5a2964b5ab2354acfcfc8 (round 63)

Don't attack other regions in same continent if we're in first 7 rounds and opponent is neir
- http://theaigames.com/competitions/conquest/games/52d596974b5ab2354acfcf4b

- Defend border region, taking into account opponent armies to be placed that round
- http://theaigames.com/competitions/conquest/games/52d3d0004b5ab2354acfbd9c (round 4/5)
7 changes: 5 additions & 2 deletions lib/Helpless/Bot/FirstBot.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ public function updateMap()
$regions = count($continent->getRegions());
$myRegions = count(\Mastercoding\Conquest\Bot\Helper\General::regionsInContinentByOwner($this->getMap(), $continent, $this->getMap()->getYou()));

// based on bonus
$bonus = $continent->getBonus();

// to capture
$priorityQueue->insert($captureStrategy, ($regions - $myRegions));
$priorityQueue->insert($captureStrategy, (($regions - $myRegions) / $bonus));

}

// set priorities
// set priorities, reversed order
$i = 1;
foreach ($priorityQueue as $captureStrategy) {

Expand Down

0 comments on commit 162ea71

Please sign in to comment.