SHARE
TWEET

text adventure

ffpaladin Jul 10th, 2013 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top