The game play area is a square grid containing ships

Assignment Help Basic Computer Science
Reference no: EM13991215

In the game of battleships, the game play area is a square grid containing ships. Players take it in turns to guess the location of the ships until the battleship is sunk.

A simple solution has been provided that has the basics of rendering a grid and asking for input. It does not look very pretty.

Your assignment is to improve on the rendering and complete the input part of the gameplay.

1. Improve the rendering so that each grid square is represented by a box created out of characters.

e.g.

#---#

| |

#---#

2. Improve the rendering so that each ship type is in a different color. Ships should be visible, not hidden from view. Yes, that's a bad game but we are just using this to test our algorithms and design.

e.g.

#---#

| S |

#---#

3. Improve the rendering so that the grid has horizontal labels (A through J) and vertical labels (1 through 10)

4. Parse the input to get the guess in the form LetterNumber e.g. B7, G10, A1. You will find String.SubString and Int32.TryParse to be useful API calls. Invalid input should cause the input to be asked again - it should not be possible to crash your program with bad input

5. When you have a valid input mark the grid location as used and then render an X in the square to indicate it has been used. The X should be Red if it was a hit on a ship.

e.g.

Miss Hit

#---# #---#

| X | | X |

#---# #---#
Notes:
· Your grid rendering must display the ships. At this stage we are just testing parts of the game so we don't need them hidden from the user. (and it makes it much harder for one of your users to grade!)
· You do not need to determine end of game conditions, validate repeated hits or any gameplay however feel free to add any of those things if you feel the urge.
· There are many useful APIs in the Console class. You may render the grid line by line using Write and WriteLine or you may render it using the SetCursorPosition API. You may redraw the entire grid each time or simply replace the sections that have changed.

· You may find it useful to set the size of the console window to something a little larger. There are APIs to do this in the Console class. The example above is just one style of drawing - feel free to experiment with different characters and grid sizes.

Reference no: EM13991215

Questions Cloud

Determine the mass-to-charge ratio of the ion : In the velocity selector the electric field has a magnitude of 8428 V/m, and the magnitude of the magnetic field in both the velocity selector and the deflection chamber is 0.0941 T. If in the deflection chamber the ion is detected at a distance o..
Explain how the strategy matches the type of environment : What type of operations and supply chain environment has more difficulty managing capacity— an environment supporting standardized products and services or one that supports customized products and services? Explain. Explain how the strategy matches ..
Main contribution to the fundamentals of organizing : What was Graicunas' main contribution to the fundamentals of organizing? The central concern of span of management is to: One of Henri Fayol's guidelines for organizing resources is to avoid red tape, regulations, and paperwork. After a manager has d..
The formation of the mitotic spindle : Many anti-cancer drugs inhibits the formation of the mitotic spindle. what affect will this have on cell division?why?
The game play area is a square grid containing ships : Improve the rendering so that each ship type is in a different color. Ships should be visible, not hidden from view. Yes, that's a bad game but we are just using this to test our algorithms and design.
What to recongizne promtoer and results in what : Core rna polmerase joins with what to recongizne promtoer and results in what
Different models of competition between firms : Discuss the similarities and differences between these special models. Be sure to explain the different circumstances where one model might be more appropriate to use than another.
What are the advantages of each type of microscopy : What are the advantages of each type of microscopy? Light vs fluorescence vs. EM and what parts of the cell is best visualized for each?
External environment assessment : Each of the following forces are outside the organization and require management to react in some way. There are comments in each section regarding the trends in this area and how they might impact the organizations performance.(Automatic Data Proces..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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