Playing The Game

The class which contains the main method for playing the game must be called BoneDig.

Your program must first hide the bones, and then ask the user to type in two integers, one for the row and one for the column of a grid position (have the user input the row first, and then the column). Your program must then read these two integers and use them to determine whether a bone is buried at that grid position. You can assume that the user will input an integer, but you must check to make sure that the integer which the user has typed is in the bounds of the grid. Your program must print the grid after each guess in the following manner: At each grid position which has been guessed so far, your program must print a character to indicate that a bone has been discovered at that position, or a character to indicate that no bone has been discovered at that grid position. At each grid position which hasn't been guessed, your program must print the character '.' to indicate that the position hasn't yet been guessed.

In addition you must print a version of the grid which shows where the bones were initially hidden. This will remain the same throughout the game, but must be printed after each guess. (This clearly ruins the game aspect since the user will be able to see where the bones are and therefore can easily 'guess' their positions, but we want you to do this so that our markers can test your program easily.)

Your program will continue to ask the user for guesses and print the two versions of the grid just described until all the bones have been discovered. Once all the bones have been discovered (and not before) the game will end.

There is no way to clear the screen in Java, so after each guess you'll be printing the two grids below the previous two grid images; as you keep doing this, the oldest grids will just 'scroll off the top' of your output window.