Revamped manager program and added manual page
Seperated controllers into AI and human controllers, which inherit from the same base class Using "human" as an argument instead of an AI program will allow human player. However, the human player has to use the CLI. I have tried playing a few games, and it is incredibly annoying using the CLI (especially when each turn was printed to stdout - now suppressed). Usually I accidentally enter the wrong coordinates, or spend 30 seconds trying to work out the coordinates of a piece. Then when I switch the focus, the SDL window goes blank, and I don't know what the hell is going on. In conclusion: Should probably add GUI for human players! Created Game class to manage playing the game, rather than hacking everything into main.cpp Added argument switches for timeouts, graphics, output file, help, allowing illegal moves, revealing colours etc Added result lines (output who actually wins... amazing!) The massive spamming output that used to be printed is suppressed (enable with -o stdout/file). Created manual.txt which is the manual page for stratego (the manager program). stratego --help will display the page (using "less" - should probably fix for systems without "less"). Changed tokens used for pieces from alphabet characters to digits for the ranked pieces, 's' for the Spy, 'B' for Bombs and 'F' for the Flag. This makes things clearer. The Spy would be "10", except thats 2 characters, which is a bit awkward! Didn't change the order of the enum, because thats just asking for trouble and besides, it works. Changed stratego to output the characters for the piece, instead of an integer rank (except for Flag, Bomb and Spy, no difference). Need to handle situations where a player has lost all their mobile pieces. Do they lose? Currently they will be forced to make an illegal move, and the other player wins by "default". Found mistake in forfax move score calculation that lead to moves having negative scores, and hence occasionally an illegal move would be chosen as more valuable than legal moves. Probably fixed. Illegal moves now score -1, so should NEVER be made! Ironically the change seemed to decrease forfax's performance against dummy. Forfax still seems to make really stupid moves, and I can't see why. Occasionally it does something smart (attacks Marshal with Spy just after the Marshal reveals itself), but I'm not sure how often these are coincidences. Even with the devaluing of moves that don't end in combat, Forfax still gets into long cycles of repeated paths with no purpose. And Forfax NEVER attacks Bombs or the Flag... even if thats all the enemy has, and even if the attacking piece would be a miner. Updated web page. Considering replacing Protocol Description as is with that written for manual.txt, which I feel is clearer. Need to make next git commit message shorter...
Showing with 1035 additions and 386 deletions