Assignment #45
Code
///Jack newsom
///period 5
///program Adventure
///filename Adventure.java
///date completed 9/25/15
import java.util.Scanner;
public class Adventure
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner( System.in );
String drink, room1, room2, A1, A2, A3, A4, A5, A6, A7, A8;
System.out.println( "You to Grandma's house. Do you enter the kitchen and say hello? ");
drink = keyboard.next();
if ( drink.equals("yes") )
{
System.out.print( "You want to sit down. Do you look for a chair in the kitchen or the basement?" );
room1 = keyboard.next();
if( room1.equals("kitchen"))
{
System.out.print( "You see Grandma and say hello. Do you eat the cookies she has out?" );
A1 = keyboard.next();
if ( A1.equals( "yes" ) )
{
System.out.println( "You accidentally eat a cookie with cyanide and die" );
}
else if ( A1.equals( "no" ) )
{
System.out.println( "Grandma beats your ass for not eating her delicious f'ing cookies" );
}
}
else if ( room1.equals("basement" ) )
{
System.out.print( "You find your old dollhouse. Do you play with it?" );
A1 = keyboard.next();
if ( A1.equals( "yes" ) )
{
System.out.println( "Your older sibling comes downstairs and beats you up for playing with a dollhouse" );
}
else if ( A1.equals( "no" ) )
{
System.out.println( "You decide to act like a mature adult. Congrats" );
}
}
}
else if ( drink.equals( "no" ) )
{
System.out.print( "You decide to wait in the Mud Room. Do you take off your shoes before going farther?" );
room1= keyboard.next();
if (room1.equals( "no" ))
{
System.out.println( "You don't take off your muddy shoes. Grandma sees the dirt you are bringing in and threatens to beat you up. Do you fight her?" );
A1 = keyboard.next();
if ( A1.equals( "yes" ) )
{
System.out.println( "You fight your grandma and she wins. You suck " );
}
else if ( A1.equals( "no" ) )
{
System.out.println( "You let your grandma beat you up. What a wimp. " );
}
}
else if ( room1.equals( "yes" ) )
{
System.out.println( "Your grandma sees that you took of your muddy shoes and offers you cookies. Do you accept? " );
A1 = keyboard.next();
if ( A1.equals( "yes" ) )
{
System.out.println( "You eat a delicious cookie." );
}
else if ( A1.equals( "no" ) )
{
System.out.println( "You don't eat the delicious cookie." );
}
}
}
}
}
Picture of the output