OOP Battleship Game
christianbm1 (16)

OOP C++ Battleship Game. It's a simple, 1 way game: player battles the computer.

There might be bugs.

Thanks a lot, Captain!

You are viewing a single comment. View All
ElliottKness (6)

Honestly, I didn't mean to find this bug, but I accidentally typed "a*" into an attack and the whole page crashed on me. It did advance to try displaying the Previous Shots, but the website otherwise seized up. I'm assuming (in Java terms) the program was trying to throw a InputMismatchException or OutOfBounds error but failed and got stuck in an infinite loop. I don't know C++ that well, but I imagine this would be a simple fix to restrict a player to a specific format of typing and denying any character that is a special character or overall invalid format.

christianbm1 (16)

@ElliottKness That's right, should be an easy fix. An overloaded Getline() and string parsing should do the trick.

ElliottKness (6)

@christianbm1 - I figured it wouldn't be too complicated. Overall, this is such a cool concept! My AP Computer Science teacher was having us build a similar style of Battleship but within Java.