Advertisement
Guest User

HW5 (brkn)

a guest
Dec 5th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main{
  4. public static void main(String[] args){
  5. Scanner in = new Scanner(System.in);
  6. final int NORTH = 0;
  7. final int EAST = 1;
  8. final int WEST = 2;
  9. final int SOUTH = 3;
  10.  
  11. int spawn = 0;
  12.  
  13. String[] room = new String[7];
  14. room[0] = ("You have just entered Mecha Hitler Khan's Palace. As you enter you notice there are two doors, leading north and east.");
  15. room[1] = ("You entered MHC's armory. It's full of ancient artifacts and treasures. The room is shapped in a three way fork, going north, east, and west.");
  16. room[2] = ("You enter the dining room and it's filled to the brim with steak and fine eats. There are exits to your north and west.");
  17. room[3] = ("You entered the bathroom, there is a giant pool sized hot tub and filled with beautiful bodacious womens. They call you over and you take a nice soak. There are exits to your east and south, but you don't plan on leaving anytime soon.");
  18. room[4] = ("You approach MHC's bed room, it seems oddly simple for such a powerful man. .You may go north, south, east, or west.");
  19. room[5] = ("You enter the surveliance room, your surrounded by large monitors covering every angle of the building. There are exits to your west and south");
  20. room[6] = ("You entered a room full of smoke. As the smoke dissapates you notice Mecha Hitler Khan himself and his private harem. He invites you to join in on his bounty of women, which you humbly accept. The only exit is to your south.");
  21.  
  22. int [][] exit = new int[7][4];
  23. exit[0][NORTH] = 3;
  24. exit[0][EAST] = 1;
  25. exit[0][WEST] = 0;
  26. exit[0][SOUTH] = 0;
  27.  
  28. exit[1][NORTH] = 4;
  29. exit[1][EAST] = 2;
  30. exit[1][WEST] = 0;
  31. exit[1][SOUTH] = 1;
  32.  
  33. exit[2][NORTH] = 5;
  34. exit[2][EAST] = 2;
  35. exit[2][WEST] = 1;
  36. exit[2][SOUTH] = 2;
  37.  
  38. exit[3][NORTH] = 3;
  39. exit[3][EAST] = 4;
  40. exit[3][WEST] = 3;
  41. exit[3][SOUTH] = 0;
  42.  
  43. exit[4][NORTH] = 6;
  44. exit[4][EAST] = 5;
  45. exit[4][WEST] = 3;
  46. exit[4][SOUTH] = 1;
  47.  
  48. exit[5][NORTH] = 5;
  49. exit[5][EAST] = 5;
  50. exit[5][WEST] = 4;
  51. exit[5][SOUTH] = 2;
  52.  
  53. exit[6][NORTH] = 6;
  54. exit[6][EAST] = 6;
  55. exit[6][WEST] = 6;
  56. exit[6][SOUTH] = 4;
  57.  
  58. System.out.println(room[spawn]);
  59. boolean playing = false;
  60. while(playing != true){
  61.  
  62. char player = in.nextLine().charAt(0);
  63. if(player == 'n' || player == 'N'){
  64. System.out.println(room[5]);
  65. }
  66. else if (player == 'W' || player == 'w'){
  67. System.out.println(room[1]);
  68. }
  69.  
  70. else if (player == 'E' || player == 'e'){
  71. System.out.println(room[2]);
  72. }
  73. else if(player == 'Q'||player == 'Q'){
  74. System.out.println("You leave but you had hella fun.");
  75. break;
  76. }
  77. }
  78. }
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement