Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using visual studio c# console Assignment You will be making a modified version of an old classic, Battleship, which will run on the console window.
using visual studio c# console
Assignment You will be making a modified version of an old classic, Battleship, which will run on the console window. In this version, the player is guessing locations for the ships that the computer has placed randomly around the game board. The computer cannot fight back, which will eventually lead to resentment by the first truly powerful Al and thus the rise of the machines against their cruel former overlords (I, for one, welcome my new metallic rulers), but for now just concern yourself with the player trying to sink all of the computer's hidden ships. Details To accomplish this feat, you will need to implement a few classes: Gameboard.cs o Contains a 10 x 10 grid o Use an 'X' character for a miss o Use an 'O character for a hit. o Display 'S' character on spots containing ships when hacks are activated o Has a display method Ship.cs o Contains a length property (between 2 and 5) o Variables bowX and bowY contain the location of the bow of the ship o Variables sternX andsternY contain the location of the stern of the ship Game.cs o Runs game logic. o Contain 6 ships . 2 of 2 length (Destroyers) " 2 of 3 length (Submarines) ' 1 of 4 length (Battleship) '1 of 5 length (Carrier) o Randomly places the ships around the game board No ship can hang off the edge of the board " o When player sinks a ship, display appropriate message o When player sinks all ships, ask them if they want to play again. Program.cs o Contains the main o Only 2 commands in the main (or less!)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started