BattleShip Program

Now that my course has ended for C programming, I would like to learn more about coding in C. I recently developed some requirements for a game. All in all, it's an in depth battleship game. I would really appreciate it if someone would write the code according to what I have provided below. Thank you and please respond with your confirmation as to whether or not you accept.



BATTLESHIP!

Two Main Fleets: Pacific Blue Fleet (PBF) and Imperial Red Fleet (IRF)

Mode:
The game should have three player modes: player vs. player or player vs. computer or computer vs. computer.

Goal:
Strategically place your ships throughout your part of the ocean to keep them away from the enemy. Try and sink the enemy by hitting their ships before they hit you!

Skill Level:
When the game is in player vs. computer mode, there should be 3 skills levels. The skill levels are as follows:

Beginner:
The computer randomly guesses selects coordinates. No intelligence involved.

Intermediate:
The computer will make an educated guess passed on previous hit. For instance, if computer achieved hit, it should check next available coordinate along x coordinate.

Expert:
The computer will make an educated guess passed on previous hit. For instance, if computer achieved hit, it should check next available coordinate along x axis and/or y axis.


Ocean Grids:
The Pacific Ocean is broken up into two ocean grids: one grid for each fleet. An ocean grid consists of a 10 x 10 grid. Each position on the grid will be represented by a two positive integers that constitutes a XY coordinate.

Ships:
There are a total of 5 ships for both the PBF and the IRF respectively. Each fleet has the same complement of ships. The description of the ships is listed below including the number of hits needed to sink a ship:

Aircraft Carrier - 5 hits
Battleship – 4 hits
Cruiser – 3 Hits
Destroyer - 3 hits
Submarine – 2 Hits


Deployment:
Each ship will be strategically placed in their part of the ocean. Ships must be placed horizontally or vertically. It can not be diagonal. Basically, for each ship placement, either the x or y coordinate must be the same for every coordinate of that particular ship. For example, a cruiser could be: (8,1) (8,2) (8,3) or a battleship could be: (5,3) (6,3) (7,3) (8,3).

How to Begin:
When the game begins, the program should prompt the PBF player to enter the coordinates of every ship in the PBF fleet one at a time. Once all of your ships have been entered, the IRF player will enter the coordinates for all of the ships of their fleet.

Game Rules:
The PBF player will fire first by entering a XY coordinate. If the entered coordinate scores a hit(i.e. the entered coordinate corresponds to a position on the ocean grid occupied by an enemy ship) the program should indicate that an enemy ship was hit. The PDF player would be allowed to enter in another coordinate. Once the PBF player one misses (selecting a coordinate that is not occupied by an enemy ship), player 2 would be asked to enter a coordinate. Once a player sinks a ship, the program should indicate that ship was sunk and specify which ship was sunk.

Note:
The program should not indicate the type of ship when it is first hit. It should only be specified once the ship is sunk. The first player that sinks all of the enemy ships will win the game.

Error Checking:
The game should have some basic error checking functionality built-in. The following functionality should be included:

The game should check to make sure that multiple ships are not placed on the same coordinates. When deploying a ship, the game should insure that the players place acceptable coordinates for each ship. For example, if a ship has a 1st coordinate of (2,1), it should not accept (3,4) as a second coordinate because they are not continuous. The game should make sure that when a player fires on a ship, they don’t select a coordinate outside of the grid. The game should make sure no ship is placed on a coordinate outside of the grid. The game should not allow a player to fire at the same coordinate more than once during a game.
I would really appreciate it if someone would write the code according to what I have provided below

Seriously?
What a load of crap. If you're trying to get someone to do your work for you, at least show some initiative. Come back with some code for a start and I'm sure people will gladly walk you through it.

If you're a CS major or anything of the sort, I really hope you reconsider what you're doing because if you're not willing to tackle problems on your own, you need to switch careers. Seriously.
Topic archived. No new replies allowed.