Please note, this experiment is no longer active and has been superseded by the C# version which is TDD driven!##
##New version is at: https://github.com/michaelokarimia/battleshipsMk2##
This code is from my Dissertation in 2005.
I thought it would be an interesting experiment to take some of the oldest code that I still have and apply the concepts I've learnt from Robert Martin's book, Clean Code.
Expect much refactoring as the codebase evolves and SOLID principles are applied to code which was written without knowledge of design patterns.
You may either run the latest unstable jarfile or run the code from a Java IDE.
-
To run the jarfile, download the battleships.jar file. You may simply open the jar file if you already have file associations set up for jar files, or if not, in the command line or terminal use the following command:
java -jar battleships.jar
-
Alternatively, open the project in your favourite Java IDE and run the class BattleshipsEngine.java. Unit tests reside in the unitTests directory and are runable under JUnit.
The goal of the project is to produce a program of the turn-based board game Battleships, where a human user plays against an Artificial Intelligence agent.
Copyright (C) 2012 Michael Okarimia
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.