Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

The Game Hurkle Project

The Game Hurkle Project

The Game Hurkle Project

The Game Hurkle
This week’s project is based on the game “Hurkle”. There are many variations of this game, and the version you will work on for your project is a one-dimensional version of it. The Hurkle is an imaginary creature that hides somewhere in a one-dimensional 1×10 integer game-space. Each time the game is run, the program places the Hurkle at a random position (0 through 10) in the game-and the player has a maximum of three (3) guesses to guess the Hurkle s location. The Hurkle does not move during the game. If the player finds the Hurkle, the program reports success and ends. If the player does not find the Hurkle the program gives a hint about what direction to move to find the Hurkle. There are two possible hints: right, or left.
The given version of the program is a console-based version (meaning the inputs and outputs happen on the console display). Run this code for the game Hurkle to see how it executes. It works well in the console but your job is to convert it for running in SWING with more graphical feedback for the user.You job is to experiment with the given code, and then adapt it by incorporating SWING features, such that the inputs and outputs will be more GUI-oriented, rather than console oriented. We’ve used SWING features in several programs already (in the lectures) and earlier project assignments, so you may want to review your textbook reading and the code examples in the week that use SWING.
Have fun, and don’t hesitate to ask questions.
import java.util.Random;
import java.util.Scanner;
publicclass Hurkle
{
publicstaticvoid main(String[] args) {
// TODO Auto-generated method stub
// gets user input for the keyboard
Scanner input = new Scanner(System.in);
//Gets a random number between 0 and 1
Random ran = newRandom();
//variable to hold the users’ guess
int usersAnswer;
finalint LIMIT = 10;
//variable to hold the system random number
int rGuess;
rGuess = ran.nextInt(LIMIT);
// Here we are creating an array of one character strings into a String variable named “˜display’
String[] display ={“0″³,”1″³,”2″³,”3″³,”4″³,”5″³,”6″³,”7″³,”8″³,”9″³,”10″};
System.out.println(“You get 3 tries to win!”);
// Tell the user how many tries they will get
for(int tries = 0; tries < 3; tries++) { //ask the user for a guess System.out.println("What is your number guess?" + "˜n'); //using the scanner class, get the user guess usersAnswer = input.nextInt(); if(usersAnswer == rGuess){ System.out.print("Bingo, you win!" + "˜n'); tries = 9999; // 9999 is used because it is so far out of bounds it has to get out of the game } else if (usersAnswer < rGuess){ display[usersAnswer] = ">“;
// replace the user guessed number with feedback: greater than, this is saving the feedback
} else{ // so it doesn’t get lost for the user
display[usersAnswer ] = “<"; // replace the user guessed number with feedback: less than } // Display the number line with feedback System.out.print("Feedback : "); for(int i=0;i

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Blackboard Experts only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Blackboard Experts are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Blackboard Experts is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Blackboard Experts, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.