Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import random
- import math
- scoreCounter = 0
- def twp(string, typewriterN):
- listOfString = list(string)
- indexOfString = list(range(len(listOfString)))
- j = 0
- while j < len(listOfString):
- print(listOfString[j], end='')
- j = j+1
- time.sleep(1/typewriterN)
- def cfnp(string, confusingN):
- listOfString = list(string)
- indexOfString = list(range(len(listOfString)))
- while len(listOfString) >= 1:
- k = random.randint(0, len(listOfString)-1)
- print(listOfString[k], end='')
- del listOfString[k]
- time.sleep(1/confusingN)
- twp("Please select language:\t ", 50)
- selectLanguage = input()
- while selectLanguage != "English":
- twp("This game is currently under testing. English is the only option.\n", 50)
- selectLanguage = input("Please select language:\t ")
- else:
- twp('How old are you? ', 50)
- pAge = str(input('My age is '))
- if int(pAge) > 15:
- twp('Minimum age requirement met.\n', 200)
- twp('Initializing....................\n', 40)
- twp('Loading....................\n', 40)
- time.sleep(1)
- else:
- twp('Minimum age requirement not met.\n', 200)
- time.sleep(1)
- twp('Initialize game in Guest Safety Mode.\n', 40)
- twp('Initializing....................\n', 40)
- twp('Loading....................', 40)
- twp("""
- ###### ###### # # # #######
- # # # # # # # # #
- # # # # # # # # #
- ###### ###### # # # # #####
- # # # # ####### # # #
- # # # # # # # # #
- ###### # # # # # ####### \n""", 1600)
- twp(
- """
- # # ####### # #
- ## # # # # #
- # # # # # # #
- # # # ##### # # #
- # # # # # # #
- # ## # # # #
- # # ####### ## ## \n""", 1600)
- twp(
- """
- # # ####### ###### # ######
- # # # # # # # # # #
- # # # # # # # # # #
- # # # # # ###### # # #
- # # # # # # # # # #
- # # # # # # # # # #
- ## ## ####### # # ####### ###### \n""", 1600)
- twp("\n \n \t \t Python Project by 'daichan21' D. Zhang. November 2014. \n ", 100)
- twp("\t \t Visit my blog DZ's Klavier @ http://daichan21.wordpress.com \n", 100)
- twp("\t \t My GitHub: daichan21 My Pastebin: daichan21 \n", 100)
- twp("\t \t Character names are based on Aldous Huxley's novel Brave New World \n", 100)
- twp("\t \t Game concept and design by D. Zhang.", 100)
- initialization = input("\n \n Enter Enter Key to start game: \n")
- while initialization != '':
- twp("Come on, you know where the Enter Key is. LOL \n", 100)
- initialization = input("Press Enter Key to start game: \n")
- else:
- twp("Nice! Your adventure starts now!\n", 100)
- birthPlace = input("Please input your place of birth.")
- twp("What is your name, \n", 30)
- twp("......Savage?\n", 20)
- playerName = input()
- time.sleep(1.5)
- twp(".....Oh I didn't realize that you are capable of speaking, hmm.. English. \n", 30)
- twp("Apologies, " + playerName + ".\n", 30)
- time.sleep(1.5)
- twp("May I know if you are male or female, " + playerName + "?\n", 30)
- print("Please enter your gender here:\t")
- playerSex = input()
- if playerSex == "Male" or playerSex == "male":
- newPlayerName = "Mr. " + playerName
- elif playerSex == "Female" or playerSex == "female":
- newPlayerName = "Ms. " + playerName
- twp("So, " + newPlayerName + ", Welcome to the \n", 30)
- twp("""
- # # ####### ###### # ######
- # # # # # # # # # #
- # # # # # # # # # #
- # # # # # ###### # # #
- # # # # # # # # # #
- # # # # # # # # # #
- ## ## ####### # # ####### ######
- ##### ####### # ####### #######
- # # # # # # #
- # # # # # #
- ##### # # # # #####
- # # ####### # #
- # # # # # # #
- ##### # # # # ####### \n""", 1800)
- twp("Stability, Community, Identity. \n", 50)
- twp("Everyone belongs to everyone else. \n ", 50)
- twp("We are the WORLD STATE. Glory to us alone! \n", 45)
- time.sleep(2)
- twp("......\n", 30)
- twp("Oh sorry, I forgot to introduce myself, \n" + newPlayerName + ".", 50)
- twp("My name is Bernard Marx, the chief emotional engineer at the\n", 50)
- twp("Central London Hatcheries and Development Centre. \n", 50)
- twp("......\n", 30)
- twp("I understand that you grew up in the land of " + birthPlace + "\n", 50)
- twp("And I also appreciate the fact that you are in a state of shock. \n", 50)
- twp("But......\n", 30)
- twp("but we will still have to test your physical skills and intellectual capability\n", 50)
- twp("in order to decide whether we should make you one of us\n", 50)
- twp("......or......\n", 30)
- time.sleep(2)
- twp("EXECUTE YOU.\n", 5)
- twp("This way please, " + newPlayerName + ". This will be really fun. \n \n \n \n", 100)
- varEmpty = input('Press Enter Key to Continue.\n \n \n \n')
- cfnp("TEST 1 - LITERACY AND COGNITIVE SKILLS LOCATION: WEST HAM, LONDON, WORLD STATE\n", 30)
- twp("TEST 1 - LITERACY AND COGNITIVE SKILLS LOCATION: WEST HAM, LONDON, WORLD STATE\n", 15)
- cfnp("TEST SUBJECT: " + "Savage" + newPlayerName + " of " + birthPlace + ", Savage Conservation\n", 30)
- twp("TEST SUBJECT: " + "Savage" + newPlayerName + " of " + birthPlace + ", Savage Conservation\n", 15)
- cfnp("CHIEF CONDUCTOR: BERNARD MARX OF WEST LONDON, WORLD STATE\n", 30)
- twp("CHIEF CONDUCTOR: BERNARD MARX OF WEST LONDON, WORLD STATE\n", 15)
- cfnp("SERIAL NUMBER: 904148\n", 30)
- twp("SERIAL NUMBER: 904148\n", 15)
- twp("BERNARD MARX: 'Savage, your sole task in this part of the test is to use the gadget in front of you, \n", 15)
- twp("which is called 'keyboard' in World State, and type out the words you see. \n", 15)
- twp("Remember that you have to type over 50% of the words/phrases correctly. Otherwise you will be electrocuted on the spot.\n", 5)
- twp("Do you understand that, " + newPlayerName + "?\n", 15)
- print("\t \t A. Yes, Mr. Marx. I will try my best to impress you.\n")
- print("\t \t B. No! What is this?! I want to go back to my homeland!\n")
- deathAnswer = input("You have two possible answers: (Please type in A or B)\n")
- twp("No matter what you say, " + newPlayerName + ". You will have to accept your fate.\n", 15)
- varEmpty2 = input('Press Enter Key to Continue.\n \n \n \n')
- obstacle1 = ['Miranda', 'Bernard', 'community', 'Mother', 'Emotional Engineer Bernard Marx', 'Everyone belongs to everyone else.']
- obstacle2 = ['Tomakin', 'Antonio', 'identity', 'Malpais', 'The Honourable Aldous Huxley', 'We are the children, the future.']
- obstacle3 = ['John', 'Savage', 'stability', 'World State', 'His Fordship Mustapha Mond', 'Our Ford is the greatest man ever lived.']
- listOfObstacles = [obstacle1, obstacle2, obstacle3]
- levelMemoryType = 0
- scoreCounter = 0
- def memoryType(levelMemoryType):
- while levelMemoryType <= 5:
- choice = random.choice(listOfObstacles)[levelMemoryType]
- twp(choice, 50)
- time.sleep(1.5)
- print()
- print("""
- """)
- twp("Please type in the word you saw.", 50)
- playerAnswerObstacle1 = input()
- if playerAnswerObstacle1 != choice:
- twp("Sorry, that was not the right answer, " + playerName + ". Please focus. \n \n", 50)
- scoreCounter = scoreCounter
- levelMemoryType = levelMemoryType + 1
- memoryType(levelMemoryType)
- else:
- twp("That's correct, " + playerName + "! It will get harder. \n \n", 50)
- scoreCounter = scoreCounter + 1
- levelMemoryType = levelMemoryType + 1
- memoryType(levelMemoryType)
- memoryType(0)
- twp("BERNARD MARX: 'Congratulations, you survived!'\n", 35)
- twp("'Now it's time for your next quest, baseball! \n", 35)
- cfnp("TEST 2 - PHYSICAL CAPABILITIES LOCATION: DODGER STADIUM, LOS ANGELES, WORLD STATE\n", 30)
- twp("TEST 2 - PHYSICAL CAPABILITIES LOCATION: DODGER STADIUM, LOS ANGELES, WORLD STATE\n", 15)
- varEmpty3 = input('Press Enter Key to Continue.\n \n \n \n')
- theZone = [' '] * 10
- twp("BERNARD MARX: 'Let's have some fun. I will be the pitcher and you will be the batter.\n'", 35)
- twp("Here's the strike zone. You see that each part of the Zone has a number on it.\n", 35)
- twp("As batter, you can pick 2 parts of the zone you are aiming at hitting.\n", 35)
- twp("You also have the choice of letting the electromagnetic computer decide for you.\n", 35)
- twp("Don't worry. The computer algorithm is purely random.\n", 35)
- twp("Do you want to hit for yourself or let the computer hit for you?\n", 20)
- twp("Choose A if you want to hit the ball yourself. Choose B for automatic control.\n", 35)
- howToHit = input()
- while howToHit == 'B':
- twp("The game is currently under testing. This function is not yet available.\n", 35)
- howToHit = input("Press A please.")
- else:
- twp("BERNARD MARX: 'Great. I, as pitcher, can choose to pitch to any part of the strike zone.\n", 35)
- twp("If you choose to swing at my pitch and one of your numbers matches my number, you will survive.\n", 35)
- twp("However, if you swing 3 times and you miss all of them. You will be executed.\n", 35)
- twp("Let's get started!\n \n \n", 30)
- time.sleep(0.76)
- def strikeZone(board):
- print(' | |')
- print(' ' + board[7] + ' | ' + board[8] + ' | ' + board[9])
- print(' 1 | 2 | 3')
- print('-----------')
- print(' 4 | 5 | 6')
- print(' ' + board[4] + ' | ' + board[5] + ' | ' + board[6])
- print(' | |')
- print('-----------')
- print(' 7 | 8 | 9')
- print(' ' + board[1] + ' | ' + board[2] + ' | ' + board[3])
- print(' | |')
- strikeZone(theZone)
- def happyEnding():
- twp("Bernard Marx decides that you are fit enough to be a part of the World State.\n", 30)
- twp("Congratulations! You've managed to achieve the impossible.\n", 15)
- twp("Thank you for playing Brave New World by D. Zhang\n", 10)
- twp("THE END", 5)
- def sadEnding():
- twp("Bernard Marx decides that you are not fit enough to be a part of the World State.\n", 30)
- twp("You have been defeated by destiny.\n", 15)
- twp("Thank you for playing Brave New World by D. Zhang\n", 10)
- twp("THE END", 5)
- def strikeZone(board):
- print(' | |')
- print(' ' + board[7] + ' | ' + board[8] + ' | ' + board[9])
- print(' 1 | 2 | 3')
- print('-----------')
- print(' 4 | 5 | 6')
- print(' ' + board[4] + ' | ' + board[5] + ' | ' + board[6])
- print(' | |')
- print('-----------')
- print(' 7 | 8 | 9')
- print(' ' + board[1] + ' | ' + board[2] + ' | ' + board[3])
- print(' | |')
- strikeZone(theZone)
- twp("Choose A if you want to hit the ball yourself. Choose B for automatic control.\n", 35)
- howToHit = input()
- while howToHit == 'B':
- twp("The game is currently under testing. This function is not yet available.\n", 35)
- howToHit = input("Press A please.")
- else:
- strikeCount = 0
- while strikeCount < 3:
- twp("\nPlease select your first number between 1 and 9:\t", 30)
- firstChoice = input()
- twp("\nPlease select your second number between 1 and 9:\t", 30)
- secondChoice = input()
- pitcherNumber = random.randint(1, 9)
- ballBank = ['75 mph curveball', '50 mph eephus', '99 mph 4 seamer fastball', '88 mph backdoor slider', '62 mph knuckleball']
- ballType = random.choice(ballBank)
- twp("Bernard Marx winds up on the mound...\n", 27)
- time.sleep(0.75)
- twp("he stretches...\n", 23)
- time.sleep(0.85)
- twp("and pitches a " + ballType + " that flies toward...\n", 15)
- time.sleep(1)
- twp(str(pitcherNumber) + " part of the strike zone!", 10)
- if firstChoice == pitcherNumber:
- break
- elif secondChoice == pitcherNumber:
- break
- else:
- strikeCount = strikeCount + 1
- if strikeCount == 3:
- twp("That is a really nasty pitch. It's impossible to locate. You miss terribly again.\n", 15)
- twp("That's the 3rd strike, and you are out. The World State will execute you.\n", 10)
- sadEnding()
- else:
- twp("You try to locate the tricky pitch, but you miss it by inches. STRIKE!\n", 15)
- twp("Strike count: " + str(strikeCount), 19)
- twp("And you aim carefully, and swing the bat with all your might!",15)
- twp("IT'S A HOMERUN!", 5)
- happyEnding()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement