Computer Science homework help

Computer Science homework help. Your task in this assignment is to implement a simplified guessing game, hinted by a well-known plastic board game called Battleship. The computer arranges ships on the grid structure in which each ship occupies a number of consecutive positions on the grid. Those ships are arranged either horizontally or vertically. The number of positions for each ship is determined by the type of the ship. The ship cannot overlap and only one ship can occupy any given position in the grid. You can play a real version on the web such as this to get an idea. The version to realize in this assignment is simpler and a one-man based game in which you are bombing those ships generated by your computer. The next sample session will illustrate the entire scheme:
There are 6 ships. Must bomb 18 places to destroy all…
<<Pacific Ocean>>
A B C D E F G H I J
1 . . . . . . . . . .
2 . . . . . . . . . .
3 . . . . . . . . . .
4 . . . . . . . . . .
5 . . . . . . . . . .
6 . . . . . . . . . .
7 . . . . . . . . . .
8 . . . . . . . . . .
9 . . . . . . . . . .
10 . . . . . . . . . .
Enter position, “show”, “init” or “quit”: 4 G
You missed 🙁
<<Pacific Ocean>>
A B C D E F G H I J
1 . . . . . . . . . .
2 . . . . . . . . . .
3 . . . . . . . . . .
4 . . . . . . – . . .
5 . . . . . . . . . .
6 . . . . . . . . . .
7 . . . . . . . . . .
8 . . . . . . . . . .
9 . . . . . . . . . .
10 . . . . . . . . . .
Enter position, “show”, “init” or “quit”: 8 b
You hit 🙂
<<Pacific Ocean>>
A B C D E F G H I J
1 . . . . . . . . . .
2 . . . . . . . . . .
3 . . . . . . . . . .
4 . . . . . . – . . .
5 . . . . . . . . . .
6 . . . . . . . . . .
7 . . . . . . . . . .
8 . @ . . . . . . . .
9 . . . . . . . . . .
10 . . . . . . . . . .
Enter position, “show”, “init” or “quit”: show
<<Pacific Ocean>>
A B C D E F G H I J
1 . * . . * * * . . .
2 . * . . . . . . . .
3 . * . . * . . . . .
4 . . . . * . – . . .
5 . . . . * . . . * *
6 . . . * * . . . . .
7 . * . * . . . . . .
8 . @ . * . . . . . .
9 . * . . . . . . . .
10 . * . . . . . . . .
Enter position, “show”, “init” or “quit”: 8 B
You bomed same place… You missed 🙁
<<Pacific Ocean>>
A B C D E F G H I J
1 . . . . . . . . . .
2 . . . . . . . . . .
3 . . . . . . . . . .
4 . . . . . . – . . .
5 . . . . . . . . . .
6 . . . . . . . . . .
7 . . . . . . . . . .
8 . @ . . . . . . . .
9 . . . . . . . . . .
10 . . . . . . . . . .
Enter position, “show”, “init” or “quit”: init
There are 6 ships. Must bomb 18 places to destroy all…
<<Pacific Ocean>>
A B C D E F G H I J
1 . . . . . . . . . .
2 . . . . . . . . . .
3 . . . . . . . . . .
4 . . . . . . . . . .
5 . . . . . . . . . .
6 . . . . . . . . . .
7 . . . . . . . . . .
8 . . . . . . . . . .
9 . . . . . . . . . .
10 . . . . . . . . . .
Enter position, “show”, “init” or “quit”: show
   <<Pacific Ocean>>
A B C D E F G H I J
1 . . . . . . . . . .
2 * . . . . . . . . .
3 * . . . . * . . . .
4 * . . . . * . . . .
5 * . . . . * . . . .
6 . * . . . . * * * *
7 . * . . . . . . . .
8 . * . . * * . . . .
9 . . . * . . . . . .
10 . . . * . . . . . .
Enter position, “show”, “init” or “quit”: quit
Bye…
The default board size is 10 x 10 and the computer arranges 6 ships of sizes between 2 and 4. The user can type in the position to aim and hit by a space-delimited pair of a row position (number) and a column position (alphabet) of the grid.  The result is hit or miss and is shown with ‘@’ or ‘-‘ respectively at the chosen position of the board.  The dot ‘.’ indicates a position for choice.  A command “show” discloses the computer’s arrangement of ships using ‘*’ (as well as ‘@’ at a damaged position). The command “init” is to reset the game by rearranging ships. The game is over when all the ships are destroyed. The ship arrangement is random. Generation either horizontal or vertical layout is also chosen at random.
 

Computer Science homework help

Solution:

15% off for this assignment.

Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!

Why US?

100% Confidentiality

Information about customers is confidential and never disclosed to third parties.

Timely Delivery

No missed deadlines – 97% of assignments are completed in time.

Original Writing

We complete all papers from scratch. You can get a plagiarism report.

Money Back

If you are convinced that our writer has not followed your requirements, feel free to ask for a refund.