an example code for battleship (C++)