Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The task is to complete find the rabbits game, where 3 rabbits randomly hide in one of the spaces of 4x4 board .the game will

image text in transcribed

The task is to complete find the rabbits game, where 3 rabbits randomly hide in one of the spaces of 4x4 board .the game will first ask the user to enter their name and age In this game, of a 4x4 board Following that, a 4x4 board will be displayed where each space is marked by a letter (from 'A' - 'P'). The program will then prompt the user to select a space and accordingly reveal whether a rabbit was hiding in that space or not. If it is, that space becomes marked with 'X Otherwise, the space becomes empty (no letter is displayed in the space Each time the game starts, the computer will randomly select 3 locations (from the available 16) to put the hiding rabbits in. After that, the player begins by trying each space individually. Once all three rabbits are found, the game terminates and informs the user how many attempts it took him/her to find the three hidden rabbits. The game contains the following 4 Java Classes: Space: This class represents the spaces in the board. The class should have attributes that tell us whether it contains a rabbit, whether that space has already been visited (revealed), and the index (position) of this space in the board (i.e. from index 0 to 15) Board: This class has spaces (16 spaces) Player: This class represents a human player, and contains a namne and age Game: This is the top level class which represents the entire game. It contains a player and a board

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

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions

Question

What is an idea to implemet honeypots that hasnt already been done?

Answered: 1 week ago