20 May Program Crawler Game
Assignment program Crawler game :
Update the Crawler game attached to allow a user to traverse the Cave. They should be prompted in each room to pick an exit or quit. Every room they enter that has a Treasure, they should earn one point. Once they quit, the total number of treasure collected, should be displayed to the screen. You should also display the total number of rooms visited. You do NOT need to let them start over, and you can not move backwards in the cave.
Just use same program which was already done in class and you need toupdate the same program ,
60 % of program was already done in class , Use same method our professor is using , I have attached youtube link of our class. Assignment should be submitted in Zip folder.
Given : entire set of codes (Program is already done 60% by the professor). Check the zip folder
https://www.youtube.com/playlist?list=PLgseIkYUa_C8_vdisgJQuZCsrIiq0q_97Class video :See video : 4/7/14 , part 1 and part 2
Small Questions for the expert after the assignment is completed: (Mandatory)
1) Which parts of the assignment were you not able to complete fully? For each, explain why you were unable to complete this part and what steps you took to attempt to complete it. Give me as much detail as possible such that I may award partial credit where it is due
2)what would you do differently if you could do this assignment again?
src/Cave.javapublic class Cave { private Room entrance; public Cave() { this.entrance = new Room(); } public void play() { this.entrance.display(); } } src/Driver.java public class Driver { public static void main(String[] args) { Cave c = new Cave(); System.out.println(“Number of Rooms: ” + Stats.roomCount()); System.out.println(“Number of Treasure: ” + Stats.treasureCount()); c.play(); } } src/Room.javaimport java.util.LinkedList; import java.util.Random; public class Room { private boolean hasTreasure; private LinkedList theExits; public Room() { Random r = new Random(); this.hasTreasure = r.nextBoolean(); if(this.hasTreasure) { Stats.addTreasure(); } theExits = new LinkedList(); int numRooms = r.nextInt(3); for(int i = 0; i < numRooms; i++) { Stats.addRoom(); theExits.add(new Room()); } } public void display() { System.out.println(“*** A Room ***”); System.out.print(“Treasure: “); if(this.hasTreasure) { System.out.println(“a pot of gold”); } else { System.out.println(“none”); } System.out.print(“Obvious Exits: “); if(this.theExits.size() == 0) { System.out.println(“none”); } else { for(int i = 0; i < this.theExits.size(); i++) { System.out.print(i + ” “); } System.out.println(“”); } System.out.println(“What would you like to do?”); //You Might want to add crap here!!!!! } } src/Stats.java public class Stats { private static int numRooms = 1; private static int numTreasure = 0; public static void reset() { numRooms = 1; numTreasure = 0; } public static void addRoom() { numRooms++; } public static void addTreasure() { numTreasure++; } public static int roomCount() { return numRooms; } public static int treasureCount() { return numTreasure; } }
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
