Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you help with the develop of battleship on python language? Please, see instructions below. I really need help. 1. Develop a Python program that

Can you help with the develop of battleship on python language? Please, see instructions below. I really need help.

image text in transcribed
1. Develop a Python program that tells the user to enter the number of rows and columns with 6. Create a function to present the on-screen game board as follows: which you want the game board. Alternatives are 10x10. 2. You must validate the user input; if you select an incorrect alternative, it displays a message stating that the entry is incorrect and that you must select again. Part 2 3. Create an array using the number of rows and columns selected by the user. 1. Continue working on the Visual Studio project called: Task6_1_ . 4. Create a function to initialize the array. In each position place a point (.) As the content, this 2. Create a function to tell the user to enter the row letter and number column where you want to make the indicates that the position has not yet been played. move. 3. After the user indicates the move he wants to make; you must confirm the move indicating if you are sure 5. Create a function to calculate the position of each ship in the array. to perform it in the selected position. a) If the user answers that he does not want to make the move, you must allow the play entry again. You must create a second matrix where the coordinates of the ships are stored. 4. Create a function to validate the move agamet the matrix containing the positions of the ships. a. Boats must be placed randomly. a) If the move was in a position where a boat is located, then you must place an 'X on the game b. Boats must be placed horizontally or vertically. board C. Boats should not be placed diagonally. d. You must place 3 ships that occupy 3 positions each. b) If the move was not in a position where a boat is located, then you should place an 'O' on the game board 5. For each move made, you must make a call to the function presented in display the game board. 9 10 . The user cannot re-enter a position that was previously played. 7. You must add each of the movements made by the user. Do not add the plays played in error or in repeated A 1-1 positions. B - I 1-1 . You must calculate the time it took the user to complete the game from the start of the program until it ends. For this you must store the time it started and the time it ended C 1-1 At the end of the game, the user will be presented with the number of plays made and the total playing time D 1 - 1 1-1 in minutes. 10. You must allow the user to see the game password when entering the row or column. In say, if the user 1-1 types "KEY" when entering the row or column, then you will show the key of the game. The key must be G 1-1 displayed in the form of a board but indicating the positions where the ships enter. 11. The functions must be written in a separate module and must be imported into initial program. H 1-1 1-1 1-1 K I Ta (Ctro)

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions