Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
command-line battleship game
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
welcome to command-line battleship! the first and current phase of this project involves simply playing battleship with your computer enemy AI. future phases will include the computer AI facing off against itself and an API or wrapper-script that will face different AI's against each other. i encourage you all to contribute your own AI's once i figure out the API/common terms they all should speak. usage: "./battleship" => regular mode "./battleship debug" => debug mode notes: - currently works much better on mac/linux due to the fact that i am using the "clear" system call to add dramatic effect to my game now there is a new battleship2 with pluggable AIs usage: ./battleship2.rb Random Human # this pits a human against the Random AI. The arguments are the AI classnames. to write an ai, create a class in ais/ that inherits from AI. It should implement: place_ships (no parameters, should return an array of Ships) move(previous_hit, previous_sink) (params tell you if prev shot hit and/or sunk a ship), should return an x,y pair. (optional) init (use if your AI needs to initialize something)