/battleship

This is an entry to the Gophercon Coding Challenge held at GopherCon India 2017

Primary LanguageGo

Battleship

This is an entry to the Gophercon Coding Challenge.

Building and running

$ git clone https://github.com/prashanthpai/battleship
$ cd battleship
$ go build battleship.go
$ ./battleship input.txt output.txt

The result of the game run is printed to stdout and also to the output file.

Sample run:

[ppai@gd2-1 battleship]$ ./battleship input.txt output.txt
Player1
O O _ _ _ 
_ X _ _ _ 
B _ _ X _ 
_ _ _ _ B 
_ _ _ X _ 

Player2
_ X _ _ _ 
_ _ _ _ _ 
_ _ _ X _ 
B O _ _ B 
_ X _ O _ 

P1:3
P2:3
It is a draw