by mago10 » Sat Nov 13, 2010 11:09 pm
My bot's ships disappears without a reason. doesn't happen with example bots.
putting the code below or changing the value of XXX changes the number of turns to disappear. Lower values of XXX takes longer to disappear:
if (pw.MyFleets().size() >= XXX) {
return;
}
(after this I execute the bot normally, so if the size is < XXX, I start fleets without watching the condition again so I can start more fleets than XXX)
(used command: java -jar tools/PlayGame-1.2.jar maps/map7.txt 1000 1000 log.txt "java MyBot" "java -jar example_bots/BullyBot.jar" | java -jar tools/ShowGame-1.2.jar)
here they are some test with different values of XXX:
without the code:
Turn 16
Player 2 Wins!
XXX=10:
Turn 18
Player 2 Wins!
XXX=5:
Turn 77
Player 2 Wins!
XXX=4:
game finishes correctly
Turn 98
Player 1 Wins!
EDIT: Solution found, it was my error, an illegal move. For debugging you can use the solution posed in