Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Please: For this assignment you will program a GUI version of a basic one player game of Battleship. The design of the GUI and

Python Please:
For this assignment you will program a GUI version of a basic one player game of Battleship. The design of the GUI and the method of user input are up to you.
The play field is represented as a 20 X 20 grid of cells. Each of the 5 ships may take up one or more cells. The ship sizes are:
Ship 13 cells
Ship 22 cells
Ship 34 cells
Ship 42 cells
Ship 53 cells
At the beginning of the game, the computer will randomly place each of the 5 ships on the playfield. Each ship must be fully on the playfield and no two ships may overlap. Ships may occupy adjacent shells, but two ships may not share the same cell.
The user is then prompted to choose a cell and the playfield is updated accordingly if the users guess misses or hits a ship. When each cell of a ship has been hit, that ship is sunk. Once all 5 ships have been sunk, the game is over and the total number of guesses the user made is displayed.

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

Step: 3

blur-text-image

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions