Outline the battleship game using oo constructs

Assignment Help Database Management System
Reference no: EM131908127

Programming Assignment- Battleship Refactor

Refactor your Battleship drawing code from Module 1.

Download the OO template for the basic battleship game, BattleshipRefactor.zip.

The template has the outline of a battleship game using OO constructs. You need to add the Grid class and complete the code so that it runs correctly.

At a minimum, you need to complete the Draw and DropBomb methods with code similar to the previous assignment. There will be changes due to the different layout, but the core of your code will do the same thing.

In this Module we are adding 2 new features:

1. Variable sized grid ­ the trivial part of this is making a 2D array based on the passed in size. The second part is adding some ships to that grid ­ we cannot use the constant array from Module 1. You need to come up with a very simple algorithm to add a few ships to the grid. This is purely test code so it doesn't have to be sophisticated in any way (there is time for that later in the class). If you can't think of any ways ask in the forums. Do not ask the user (your teacher) for input to place these ships.

2. Game over detection - This will be implemented in the readonly property Grid.HasShipsLeft. In this property you will determine if there are any ships left not hit with a bomb. The algorithm should look through the array for any remaining ships each time the property is read.

You may add as many other methods, fields or properties as you feel are required for the assignment.

Notes:

The code will be tested with grids ranging in size from 5 (the smallest you can fit a size 5 ship) upwards. Make sure that all aspects of the game work correctly without crashing or hanging.

You must use the template code provided!

Like in Module 1, Make sure you show the ships in the grid. At this point we are merely testing our game logic and hidden ships make the game very hard to test.

Attachment:- Battleship-Refactor.zip

Reference no: EM131908127

Questions Cloud

Benefits of normal data versus skewed data : Are people scared of skewed data? What are the benefits of normal data versus skewed data?
Number of items produced : The? cost, C(x), and? revenue, R(x), are functions for a particular company. The x represents the number of items produced and sold to distributors.
Find the flow across s when n points upward : Let V be the velocity field V (x, y, z) = (y, z, x^2 ). Find the flow across S when n points upward. Explain your answer.
What suggestions or strategies would you recommend : If you could advise your boss about change management, what suggestions or strategies would you recommend? What if the change that is going to take place.
Outline the battleship game using oo constructs : The template has the outline of a battleship game using OO constructs. You need to add the Grid class and complete the code so that it runs correctly.
Some of motives for mergers lead to benefits : Some of the motives for mergers lead to benefits for society, some to shareholders,
State the dependent variable : 1. State the dependent variable. 2. Explain whether Lucy should use a one-tailed or a two-tailed z-test and explain why.
Where is the line between effective and chaotic change : Where is the line between effective change and chaotic change? What are some elements a manager needs to keep in mind in order to create effective change.
Estimate the temperature difference : Use the exponential function to estimate the temperature difference y when 35 minutes have elapsed. Report your estimated temperature difference

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd