I developed this game during my 5th year at Polytech Montpellier, in CS & Management. Built with Scala (v2.12.6), SBT and uses ScalaTest and TypeSafe Config. I tried as much as possible to maintain a RT-friendly code, with pure functions in order to test it easily.
Open a terminal, cd to the project folder and then run the sbt run command. You wil be asked to chose between 2 main classes: BattleShipGame and TestAI (see below, "Main classes" section).
You can also generate the .jar file and specify in the MANIFEST.MF file which main class you want to use.
You can specify the number of games to play when you are testing AIs in the application.conf file (default: 100).
Player a game versus a friend or an AI (low, medium and hard).
Launch multiple games (default: 100) between the 3 AI and get the final result printed or written in a CSV file. For example, I got the following results with 20 000 games played between each AI (low VS medium, low VS hard, medium VS hard):
AI Name | Score | AI Name2 | Score2 |
---|---|---|---|
AI Level Beginner | 5 | AI Level Medium | 19995 |
AI Level Beginner | 0 | AI Level Hard | 20000 |
AI Level Medium | 274 | AI Level Hard | 19726 |