Advertisement
scaawt

csce hw02redo

Sep 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.20 KB | None | 0 0
  1. /**
  2.  * Written by Tariq Scott
  3.  */
  4. import java.util.Scanner;
  5. public class Homework02 {
  6.  
  7.  
  8.   public static void main(String[] args) {
  9.     Scanner keyboard = new Scanner(System.in);
  10.         //Prompting the user
  11.        
  12.         System.out.println ("Welcome to the Zombie Escape Simulator! Would you like to start off in the city, suburbs, or rural area? Enter 'city', 'suburbs', or 'rural'");
  13.         String one = keyboard.nextLine();
  14.         if (one.equals("city")) {
  15.             {
  16.                 System.out.println ("You wake up from your apartment and you see zombies outside. Do you sleep it away or do you prepare for battle? Enter 'sleep' or 'prepare'");
  17.                 String two = keyboard.nextLine();
  18.               if (one.equals("rural"))
  19.                
  20.                 System.out.println("You are tending to animals in your barn when you see zombies coming straight to you. Do you battle them, or sacrifice your livestock? Enter 'battle' or 'sacrifice'");
  21.                 String won = keyboard.nextLine();
  22.                 if (won.equals("battle"))
  23.  
  24.                 if (two.equals("sleep")) {
  25.                     System.out.println("You chose to sleep. The zombies entered your apartment and swallowed you whole. The end.");
  26.                 }
  27.  
  28.                
  29.                 if (two.equals("prepare"))
  30.                     System.out.println("You gear up, and you make a break for it, but the dead are everywhere. Do you run for the alley or fight in the street? Enter 'alley' or 'fight'");
  31.                     String three = keyboard.nextLine();
  32.  
  33.  
  34.                     if (three.equals("alley")) {
  35.                     System.out.println("You run through the alley and you see someone pull around in a van and tells you to get inside. Do you join, or do you run? Enter 'join', or 'run'");
  36.                     }
  37.  
  38.                    
  39.               if (three.equals("fight")) {
  40.                         System.out.println ("You literally fight to death and you do not make it. The end.");
  41.                         System.exit(0); }
  42.                    
  43.                     if (three.equals("join"))    
  44.                         System.out.println("You hop in the van with the woman and she says she's going back to her camp. Do you stay with her, or jump out of the van? Enter 'stay' or 'jump'");
  45.                         String four = keyboard.nextLine();
  46.                
  47.               if (four.equals("stay"))
  48.                         System.out.println("You make it to her camp, and you defend against zombies until the end of time. You win!");
  49.                    
  50.               if (four.equals ("jump")) {
  51.                             System.out.println("You jump out of the van, and you twist your ankle. Zombies see you and feast upon you. The end.");
  52.               System.exit(0); }
  53.                            
  54.        if (one.equals("suburbs"))
  55.                 System.out.println("You're reading a book in your room when you suddenly hear zombies approaching. Do you ignore them or drive off in your car? Enter 'ignore' or 'drive'");
  56.                
  57.               String uno = keyboard.nextLine();
  58.                 if (uno.equals("ignore"))
  59.                     System.out.println("You end up finishing your book, but the zombies devour you whole. The end.");
  60.                 if (uno.equals("drive"))  
  61.                     System.out.println("You barely bust through your garage and escape the zombies. Do you head for the woods, or head to the market for food? Enter 'woods' or 'market;");
  62.                    
  63.               String dos = keyboard.nextLine();
  64.                 if (dos.equals("woods"))
  65.                         System.out.println("You make it to the woods where you set up shop. At night, you hear a noise. Do you check it out, or stay put? Enter 'check' or 'stay'");
  66.                        
  67.               String tres = keyboard.next();
  68.                
  69.                 if (dos.equals("market"))
  70.                    System.out.println("You make it to the market, but you are overrun by the other living dead who also thought it was a good idea to go to the market. The end.");
  71.  
  72.                    
  73.                    
  74.                
  75.                 }
  76.                     }
  77.         }
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement