Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class GameMain{
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- /**
- * Made by Walker Christie
- */
- Scanner input = new Scanner(System.in);
- System.out.println("Welcome to the memory game.");
- System.out.println("Please enter your name below.");
- String playername = input.nextLine();
- System.out.println("");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException x) {
- }
- // How to play (instructions)
- System.out.println("-------------------------------------------------------------");
- System.out.println("|How to Play|");
- System.out.println("1) Words will be listed in a certain order");
- System.out.println("2) Re-enter the words in the order that they were listed");
- System.out.println("3) If a word was re-entered incorrectly, the game will reset");
- System.out.println("4) Seperate words with commas 'first, second, third, etc'");
- System.out.println("5) You will be given a total of 5 seconds to enter the word");
- System.out.println("-------------------------------------------------------------");
- System.out.println("Please enter 'begin' to start the game.");
- String begin = input.nextLine();
- if(begin.equals(begin)){
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("Initiating Game...");
- //Level 1
- try {
- Thread.sleep(1000);
- } catch (InterruptedException x) {
- }
- // The first word in the game
- String word1 = "dog";
- // Will print the word into the console
- System.out.print("your word is "+word1+"");
- try {
- Thread.sleep(3000);
- } catch (InterruptedException x) {
- }
- System.out.println("");
- System.out.println("Now, re-enter 'dog' into to the console");
- String test1 = input.nextLine();
- System.out.println("");
- /**
- * Will test to see
- * If word entered, matches the word generated
- */
- if(!test1.equals("dog")){
- System.out.println("You have lost, please restart");
- String lost1 = input.nextLine();
- }
- if(test1.equals(word1)){
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("---------------------------");
- System.out.println("That matched, good job");
- System.out.println("Onto, the next word");
- System.out.println("---------------------------");
- //Level 2
- try {
- Thread.sleep(1000);
- } catch (InterruptedException x) {
- }
- System.out.println("");
- System.out.println("");
- String word2 = "computer";
- System.out.println("Your next word is "+word2+"");
- System.out.println("Now, you must enter the two words given, in order.");
- System.out.println("You must enter 'dog, computer' into the console to move on");
- String test2 = input.nextLine();
- if (!test2.equals("dog, computer")) {
- System.out.println("You have lost, please restart");
- System.out.println("You did not conmplete the tutorial stage.");
- String lost2 = input.nextLine();
- }
- if(test2.equals("dog, computer")){
- System.out.println("Good job, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("--------------------------------------------------------");
- System.out.println("The tutorial stage is now over, initiating full game...");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException x) {
- }
- System.out.println("Full game loaded");
- System.out.println("--------------------------------------------------------");
- System.out.println("");
- //Level 3
- String word3 = "water";
- System.out.println("Your new word is "+word3+"");
- System.out.println("Please enter the words in order");
- String test3 = input.nextLine();
- if(!test3.equals("dog, computer, water")){
- System.out.println("You have lost, please restart");
- System.out.println("You did not conmplete the tutorial stage.");
- String lost3 = input.nextLine();
- }
- if(test3.equals("dog, computer, water")){
- System.out.println("That is correct, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- String word4 = "flour";
- //Level 4
- System.out.println("Your new word is "+word4+"");
- System.out.println("Please enter the words in order");
- String test4 = input.nextLine();
- if(!test4.equals("dog, computer, water, flour")){
- System.out.println("You have lost, please restart");
- String lost4 = input.nextLine();
- }
- if(test4.equals("dog, computer, water, flour")){
- System.out.println("That is correct, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- //Level 5
- String word5 = "table";
- System.out.println("Your new word is "+word5+"");
- System.out.println("Please enter the words in order");
- String test5 = input.nextLine();
- if(!test5.equals("dog, computer, water, flour, table")){
- System.out.println("You have lost, please restart");
- System.out.println("You finished with 5 points");
- System.out.println("You can do better!");
- String lost5 = input.nextLine();
- }
- if(test5.equals("dog, computer, water, flour, table")){
- System.out.println("That is correct, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- //Level 6
- String word6 = "card";
- System.out.println("Your new word is "+word6+"");
- System.out.println("Please enter the words in order");
- String test6 = input.nextLine();
- if(!test6.equals("dog, computer, water, flour, table, card")){
- System.out.println("You have lost, please restart");
- System.out.println("You finished with 6 points");
- System.out.println("Pretty good!");
- String lost6 = input.nextLine();
- }
- if(test6.equals("dog, computer, water, flour, table, card")){
- System.out.println("That is correct, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- //Level 7
- String word7 = "block";
- System.out.println("Your new word is "+word7+"");
- System.out.println("Please enter the words in order");
- String test7 = input.nextLine();
- if(!test7.equals("dog, computer, water, flour, table, card, block")){
- System.out.println("You have lost, please restart");
- System.out.println("You finished with 7 points");
- System.out.println("Pretty good!");
- String lost7 = input.nextLine();
- }
- if(test7.equals("dog, computer, water, flour, table, card, block")){
- System.out.println("That is correct, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- //Level 8
- String word8 = "air";
- System.out.println("Your new word is "+word8+"");
- System.out.println("Please enter the words in order");
- String test8 = input.nextLine();
- if(!test8.equals("dog, computer, water, flour, table, card, block, air")){
- System.out.println("You have lost, please restart");
- System.out.println("You finished with 8 points");
- System.out.println("Good memorization!");
- String lost8 = input.nextLine();
- }
- if(test8.equals("dog, computer, water, flour, table, card, block, air")){
- System.out.println("That is correct, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- //Level 9
- String word9 = "section";
- System.out.println("Your new word is "+word9+"");
- System.out.println("Please enter the words in order");
- String test9 = input.nextLine();
- if(!test9.equals("dog, computer, water, flour, table, card, block, air, section")){
- System.out.println("You have lost, please restart");
- System.out.println("You finished with 9 points");
- System.out.println("Fantastic memorization!");
- String lost9 = input.nextLine();
- }
- if(test9.equals("dog, computer, water, flour, table, card, block, air, section")){
- System.out.println("That is correct, moving on.");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("");
- //Level 10
- String word10 = "string";
- System.out.println("Your new word is "+word10+"");
- System.out.println("Please enter the words in order");
- String test10 = input.nextLine();
- if(!test10.equals("dog, computer, water, flour, table, card, block, air, section, string")){
- System.out.println("You have lost, please restart");
- String lost10 = input.nextLine();
- System.out.println("You finished with 10 points");
- System.out.println("Fantastic work! Very close!");
- }
- if(test10.equals("dog, computer, water, flour, table, card, block, air, section, string")){
- System.out.println("That is correct!");
- System.out.println("");
- System.out.println("-------------------------------------------------");
- System.out.println("Congratulations "+playername+"...");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException x) {
- }
- System.out.println("you have won the memory game!");
- System.out.println("You finished with a total of 15 points!");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException x) {
- }
- System.out.println("Care to play again?");
- System.out.println("-------------------------------------------------");
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment