logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Nikhil AroraGeneral article writing
(5/5)

589 Answers

Hire Me
expert
Jordan CarterEngineering
(5/5)

817 Answers

Hire Me
expert
Rex HuntGeneral article writing
(5/5)

885 Answers

Hire Me
expert
StatAnalytica ExpertGeneral article writing
(5/5)

510 Answers

Hire Me
Others
(5/5)

a location is legal if the entire ship is within the game board and none of the routes the ship is going to cover already contain a ship

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

C. A matrix or list of lists with Boolean values that say whether this route has already been shot at or not. This matrix should have 10x10 elements where all start with the value False. For a list of lists you must first create the outer list, insert 10 inner lists, and for each inner list insert 10 False values. If you want to use a 10x10 numpy array, you can use 0 for False and 1 for True. A matrix or list of references. This matrix should have 10x10 elements where all start with the value None. A list of lists is made as in the previous subtask. To create an array, you must specify the parameter "d type = object" to np.zeros to create a numpy array that accepts objects and not just numbers.

Exercise 2) Create a method to check if the placement of a ship is legal. A location is legal if the entire ship is within the game board and none of the routes the ship is going to cover already contain a ship. Use the matrix from problem b–d to check if the routes already contain a ship. The method should take the start coordinates, the length and direction of the imagined ship as parameters. The method should return True or False.

Exercise 3) Create a method that places a ship. It must first use the method from the previous subtask to check that the placement is legal. If the location is legal, it should create a new Ship object and put it in the list of ships. In the reference matrix (subtasks b -d)it should set all the routes that the ship covers to refer to the ship (instead of being None). The method should return True if the placed ship and False if the location was illegal.

Exercise 4) Create a method that shoots on a route. The method should take the coordinates of the route as parameters. The method must first check whether the user has already shot at the route. If not, it should check if the route contains a ship. If it contains a ship, it shall call the hit () method of the ship. Regardless of the shell cell of the square the user has shot at in the matrix over hits is set equal to True 

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme