Assignment #77 Advenute 2
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: Adventure 2
///File Name: A2.java
import java.util.Scanner;
public class A2
{
public static void main( String[] args )
{
Scanner momo= new Scanner(System.in);
int n=1;
String c="";
while (n !=0)
{
if (n==1)
{
System.out.println(" You are in a haunted sewer. Do you float down the sewage river or go down a dark tunnel? Answer options: river or tunnel.");
c=momo.nextLine();
if (c.equals("river"))
n=2;
else if (c.equals("tunnel"))
n=3;
else
System.out.println(" Not an option stupid!");
}
if (n==2)
{
System.out.println(" You are casually floating down the sewage river. You can swim back up or play with the sewage fish. Answer options: up or fish.");
c=momo.nextLine();
if(c.equals("up"))
n=1;
else if(c.equals("fish"))
n=4;
else
System.out.println(" System no comprehende ");
}
if (n==3)
{
System.out.println(" You come across a radioactive waste land. You can swim in the waste and hope to become spiderman or you can go back to the beginning. Answer options: swim or beginning.");
c=momo.nextLine();
if (c.equals("swim"))
n=4;
else if (c.equals("beginning"))
n=1;
else
System.out.println("No comprehende");
}
if (n==4)
{
System.out.println(" A Swarm of fish surround you. You look closely at them and discover they are quite strange looking. They have 7 eyes and neon green and purple sharp teeth. You realize that these fish are radioactive. One bites you and a green ooze starts flowing from your mouth. Before you know it you are Super Fish!");
n=0;
}
}
System.out.println(" Game is over!");
}
}
Picture of Output