项目作者: prashanthpai

项目描述 :
This is an entry to the Gophercon Coding Challenge held at GopherCon India 2017
高级语言: Go
项目地址: git://github.com/prashanthpai/battleship.git
创建时间: 2017-02-24T19:17:23Z
项目社区:https://github.com/prashanthpai/battleship

开源协议:

下载


Battleship

This is an entry to the Gophercon Coding Challenge.

Building and running

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

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

Sample run:

  1. [ppai@gd2-1 battleship]$ ./battleship input.txt output.txt
  2. Player1
  3. O O _ _ _
  4. _ X _ _ _
  5. B _ _ X _
  6. _ _ _ _ B
  7. _ _ _ X _
  8. Player2
  9. _ X _ _ _
  10. _ _ _ _ _
  11. _ _ _ X _
  12. B O _ _ B
  13. _ X _ O _
  14. P1:3
  15. P2:3
  16. It is a draw