Writing a C++ Battleship Program Using Linux

For an experienced C++ programmer, this should be pretty simple. I just need a battleship program that follows some specific guidelines.

This will be a two player game, no computer players involved. Each player will place their five ships (horizontally or vertically) on a 10x10 board, with no overlapping or overhang. After each player places their ships, the screen will be cleared so that the opponent cannot see the other player's board (using system(“clear”) from #include ). Here are the ships each player has:

1 Aircraft Carrier, 5 spots

1 Battleship, 4 spots

1 Destroyer, 3 spots

1 Submarine, 3 spots

1 Patrol Boat, 2 spots

Once each player has set their ships, they will choose a position on the board to attack (the columns will be labeled as A-J and the rows will be labeled as 1-10) in the form "row column" such as 5 C. A hit on an opponent ship will be labeled with an X, and a miss with an O (both will let the player know if they hit or missed). Unfired spaces remain blank. Once an opponent ship has been sunk, the game will announce so, and continue until all ships are sunk on either team. Once a team wins, the game will declare the winner and end.

The one requirement for using functions is that the functions, including main(), cannot have over 15 lines (a few extra is fine, but no more than twenty) of code, this doesn't include comments or blank lines. main() should be used primarily for calling the other functions. The functions I'd like to use are:

initialize_board() which initializes the boards to spaces

determine_player_choice() which allows players to pick their spot on their opponents grid

fill_board() which fills the board with the player’s choice

print_board() that prints the board to the screen after each user’s turn

check_for_winner() which checks to see if there is a winner

print_winner_results() that prints the results of the game to the screen.

Any other needed functions should be named in the same formatting as above.

I also would like the program to use at least one class and one struct, though it doesn't really matter how they are used.

The headers I have listed to use currently are:






No imported headers should be used. Any other header that works with Linux is okay.

I need the program done as soon as possible.

Compétences : Programmation C++

en voir plus : battleship program, battleship class, battleship game computer, opponent board battleship, battleship headers, battleship computer opponent, writing that works, writing spaces, writing lines, writing in the works, writing functions, writing computer code, writing checks, writing boards, writing a will, writing a computer program, struct c programming, programming board game, programming a computer game, pretty writing

Concernant l'employeur :
( 1 commentaire ) Olympia, United States

Nº du projet : #4002604

Décerné à:


Hi, I'd like to do this project please. Kindly check your inbox for my inquiries and let me know if you are interested. Thanks.

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 0 jours
(55 Commentaires)

3 freelance font une offre moyenne de $53 pour ce travail


Let me help you. Check your pm for more details.-------------------------------------------------------------------------------------------------------------------

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(16 Commentaires)

Hello Sir, Expert programmer here with almost 5 year experience in C/C++ . I am ready to start and will complete within deadline. Please let me help you. Thanks,

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(1 Évaluation)