Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mathgame;
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- import java.util.Scanner;
- /**
- * HERRO!!!
- * @author jared.dubose
- */
- public class Main1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws InterruptedException {
- Scanner input = new Scanner(System.in);
- System.out.print("Name: ");
- String playerName = input.nextLine();
- String[] profanity = {"penis","fuck","bitch","dick","ass","whore","cunt","slut","tak","lance"," " };
- for ( String curse : profanity ) {
- if (playerName.contains(curse)) {
- System.out.println("invalid symbols/words(no spaces please)");
- System.exit(0);
- }
- }
- System.out.print("Welcome, "+playerName+"! \r");
- Thread.sleep(2 * 1000); //sleep 4 seconds
- System.out.print("You are an awesome explorer, and you just found a \r");
- Thread.sleep(2 * 1000); //sleep 4 seconds
- System.out.print("hidden cave in the mountains of Narnia \r"); //maintain equal spacing or it will come out odd. each line overwrites the previous.
- Thread.sleep(2 * 1000); //sleep 4 seconds
- System.out.print("While walking through the cave an evil ogre jumps around the corner,\r");
- Thread.sleep(2 * 1000); //sleep 4 seconds
- System.out.print("to live you must solve 2 + 1 \r");
- Thread.sleep(2 * 1000); //sleep 4 seconds
- System.out.print("your answer is: ");
- int live1 = input.nextInt();
- if (live1 == 3){
- System.out.println("good job! You survived! Your answer was " + live1);
- } else {
- System.out.println("Sorry you're dead");
- Thread.sleep(3 * 1000);
- System.exit(0);
- }
- System.out.println("Congratulations You've won :)");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement