command-line battleship game
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ais
README
ai.rb
battleship.rb
battleship2.rb
battleship3.rb
board.rb
player.rb
ship.rb

README

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)