Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this project in C and would appreciate help with it. CS 100 Programming I Project 3 Revision Date: October 2, 2015

I need help with this project in C and would appreciate help with it.image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

CS 100 Programming I Project 3 Revision Date: October 2, 2015 Preamble You may develop your code anywhere, but you must ensure it runs correctly on a Linux distribution before submission Battleship! "You sunk my battleship!" - Annoying TV Kid Battleship is a classic Milton-Bradley game, where two players, in secret, position their navy on a grid. Each ship in the navy covers a contiguous horizontal or vertical section of grid cells. The type of ship determines the number of grid cells covered. The players, in turn, lob salvos at each other's navy by calling out grid locations. Should a salvo coincide with a grid cell covered by a ship location, the attacked player calls out "hit". If the salvo does not coincide with a cell covered by a ship, the attacked player calls out "miss". If all the cells covered by a single ship are hit, the attacked player calls out "sunk". The first player to sink all of the opponent's ship wins. Here is an example of one player's grid after three salvos by the opponent The salvo to grid location (2,8) was a miss, the one to location (4,5) was a hit, and the one to (5,5) was another miss. The grid also illustrates a typical navy: a carrier in blue, a battleship in green, a destroyer in red, a submarine in aqua, and a patrol torpedo boat in yellow Your task is to build a battleship-playing program that will outsmart your classmates programs May the best program win! CS 100 Programming I Project 3 Revision Date: October 2, 2015 Preamble You may develop your code anywhere, but you must ensure it runs correctly on a Linux distribution before submission Battleship! "You sunk my battleship!" - Annoying TV Kid Battleship is a classic Milton-Bradley game, where two players, in secret, position their navy on a grid. Each ship in the navy covers a contiguous horizontal or vertical section of grid cells. The type of ship determines the number of grid cells covered. The players, in turn, lob salvos at each other's navy by calling out grid locations. Should a salvo coincide with a grid cell covered by a ship location, the attacked player calls out "hit". If the salvo does not coincide with a cell covered by a ship, the attacked player calls out "miss". If all the cells covered by a single ship are hit, the attacked player calls out "sunk". The first player to sink all of the opponent's ship wins. Here is an example of one player's grid after three salvos by the opponent The salvo to grid location (2,8) was a miss, the one to location (4,5) was a hit, and the one to (5,5) was another miss. The grid also illustrates a typical navy: a carrier in blue, a battleship in green, a destroyer in red, a submarine in aqua, and a patrol torpedo boat in yellow Your task is to build a battleship-playing program that will outsmart your classmates programs May the best program win

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

3. You can gain power by making others feel important.

Answered: 1 week ago