Text adventure

  • Published on
    12-Jul-2015

  • View
    154

  • Download
    1

Embed Size (px)

Transcript

<ul><li><p>123456789101112131415161718192021222324252627282930</p><p>//**********************************************************// Assignment: Final Project//// Author: Andrew D. MacKoul//// Completion time: 12 hours//// Honor Code: I pledge that this program represents my own// program code. I received help from Prof. Vanselow // program code. I received help from Prof. Vanselow // in designing and debugging my program.//*********************************************************package finale;package finale;package finale;package finale;</p><p>import java.util.Random;import java.util.Random;import java.util.Random;import java.util.Random;import java.util.Random;import java.util.Random;import java.util.Random;import java.util.Random;import java.util.Scanner;import java.util.Scanner;import java.util.Scanner;import java.util.Scanner;import java.util.Scanner;import java.util.Scanner;import java.util.Scanner;import java.util.Scanner;</p><p>public class public class public class public class Finale { {</p><p> public static void public static void public static void public static void public static void public static void public static void main(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) { int crash = 0; int crash = 0; int crash = 0; int crash = 0; int crash = 0; int crash = 0; int crash = 0; int crash = 0; int crash = 0; // Introduction is outside the loop so it doesn't repeat when you fail. // Introduction is outside the loop so it doesn't repeat when you fail. introduction. introduction. introduction.introductionking();();(); while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { while (crash != 1) { crash = 0; crash = 0; crash = 0; crash = 0; crash = 0; crash = 0; crash = 0; try { try { try { try { Finale. Finale. Finale.finaleKing(args);(args);(args);(args); crash++;//kills the program crash++;//kills the program crash++;//kills the program crash++;//kills the program crash++;//kills the program } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { } catch (Exception e) { System. System. System.out.println("Please enter the number of the road you wi".println("Please enter the number of the road you wi".println("Please enter the number of the road you wi".println("Please enter the number of the road you wi".println("Please enter the number of the road you wi".println("Please enter the number of the road you wi" + "sh to travel down."); + "sh to travel down."); + "sh to travel down."); + "sh to travel down."); + "sh to travel down."); + "sh to travel down."); + "sh to travel down."); + "sh to travel down."); } } } } } }</p><p> public static void public static void public static void public static void public static void public static void public static void finaleKing(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) {(String[] args) { Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System. Scanner in = new Scanner(System.in); ); ); int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int option, scan, randomNum, choosenum; int loopkill = 0; int loopkill = 0; int loopkill = 0; int loopkill = 0; int loopkill = 0; int loopkill = 0; int loopkill = 0; int loopkill = 0; int loopkill = 0; int loopkill = 0; </p><p> while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { while (loopkill != 1) { scan = 0; scan = 0; scan = 0; scan = 0; scan = 0; scan = 0; scan = 0;</p><p> Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); Random rn = new Random(); int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int n = 15 - 2 + 1; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; int i = rn.nextInt() % n; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; randomNum = 1 + i; choosenum = Math. choosenum = Math. choosenum = Math. choosenum = Math. choosenum = Math. choosenum = Math. choosenum = Math.abs(randomNum);(randomNum);(randomNum);(randomNum); if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { if (choosenum == 0) { choosenum++; choosenum++; choosenum++; choosenum++; } }</p><p> System. System. System.out.println("You have 6 roads infront of you.");.println("You have 6 roads infront of you.");.println("You have 6 roads infront of you.");.println("You have 6 roads infront of you.");.println("You have 6 roads infront of you.");.println("You have 6 roads infront of you.");.println("You have 6 roads infront of you.");.println("You have 6 roads infront of you."); System. System. System.out.println("1: The first road leads to the land of".println("1: The first road leads to the land of".println("1: The first road leads to the land of".println("1: The first road leads to the land of".println("1: The first road leads to the land of".println("1: The first road leads to the land of" + " variable knowledge."); + " variable knowledge."); + " variable knowledge."); + " variable knowledge."); + " variable knowledge."); + " variable knowledge."); + " variable knowledge."); + " variable knowledge."); System. System. System.out.println("2: The second road leads to the town hall ".println("2: The second road leads to the town hall ".println("2: The second road leads to the town hall ".println("2: The second road leads to the town hall ".println("2: The second road leads to the town hall ".println("2: The second road leads to the town hall " + "where the king conducts his operations."); + "where the king conducts his operations."); + "where the king conducts his operations."); + "where the king conducts his operations."); + "where the king conducts his operations."); + "where the king conducts his operations."); + "where the king conducts his operations."); + "where the king conducts his operations."); System. System. System.out.println("3: The third road leads to the land of ".println("3: The third road leads to the land of ".println("3: The third road leads to the land of ".println("3: The third road leads to the land of ".println("3: The third road leads to the land of ".println("3: The third road leads to the land of " + "'arithmos' meaning arithmetic in greek."); + "'arithmos' meaning arithmetic in greek."); + "'arithmos' meaning arithmetic in greek."); + "'arithmos' meaning arithmetic in greek."); + "'arithmos' meaning arithmetic in greek."); + "'arithmos' meaning arithmetic in greek."); + "'arithmos' meaning arithmetic in greek."); + "'arithmos' meaning arithmetic in greek."); System. System. System.out.println("4: The fourth road leads to our water sourc".println("4: The fourth road leads to our water sourc".println("4: The fourth road leads to our water sourc".println("4: The fourth road leads to our water sourc".println("4: The fourth road leads to our water sourc".println("4: The fourth road leads to our water sourc" + "e, they control the flow of resources for the land." + "e, they control the flow of resources for the land." + "e, they control the flow of resources for the land." + "e, they control the flow of resources for the land." + "e, they control the flow of resources for the land." + "e, they control the flow of resources for the land." + ""); + ""); + ""); + ""); + ""); + ""); System. System. System.out.println("5: The fifth road leads to the circus, many".println("5: The fifth road leads to the circus, many".println("5: The fifth road leads to the circus, many".println("5: The fifth road leads to the circus, many".println("5: The fifth road leads to the circus, many".println("5: The fifth road leads to the circus, many" + " fun rides there, they just go in circles till you " + " fun rides there, they just go in circles till you " + " fun rides there, they just go in circles till you " + " fun rides there, they just go in circles till you " + " fun rides there, they just go in circles till you " + " fun rides there, they just go in circles till you " + "stop them."); + "stop them."); + "stop them."); + "stop them."); + "stop them."); + "stop them."); + "stop them."); + "stop them."); System. System. System.out.println("6: This road leads to the dark brotherhood".println("6: This road leads to the dark brotherhood".println("6: This road leads to the dark brotherhood".println("6: This road leads to the dark brotherhood".println("6: This road leads to the dark brotherhood".println("6: This road leads to the dark brotherhood" + ", they are assassins, their methods are...." + ", they are assassins, their methods are...." + ", they are assassins, their methods are...." + ", they are assassins, their methods are...." + ", they are assassins, their methods are...." + ", they are assassins, their methods are...." + " questionable."); + " questionable."); + " questionable."); + " questionable."); + " questionable.");...</p></li></ul>