Advertisement
ffpaladin

text adventure

Jul 10th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1.  
  2. // written by a TA for a class
  3.  
  4. import java.util.ArrayList;
  5. import java.util.List;
  6. import java.util.Scanner;
  7.  
  8.  
  9. public class game {
  10.  
  11.  
  12.  
  13. //GLOBAL VARIABLES can be seen EVERYWHERE
  14.  
  15. // INVENTORY
  16.  
  17.  
  18.  
  19.  
  20.  
  21. public static void main(String[] args){
  22.     System.out.println("you are in a field");
  23. List<String> inputlist= new ArrayList<String>();
  24.  
  25. Scanner keyboard= new Scanner(System.in);
  26.  
  27. String input= keyboard.next();
  28.  
  29. inputlist.add(input);
  30.  
  31.  
  32.  
  33. if (inputlist.contains("north")){
  34.     north();
  35. }
  36.     else{
  37.         System.out.println("you should go north");
  38.     }
  39. }
  40.  
  41.  
  42. private static void north() {
  43.     System.out.println("you went north");
  44.    
  45. }
  46.  
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement