import builtins as _b _b.input = (lambda read: lambda prompt="": read(str(prompt)))(_b.input) del _b try: exec(compile("#YOURE NOT SUPPOSED TO BE HERE.\nimport time \nimport random\nchances = 0\nachieved = 0\nplaythroughs = 0\n\ndef lal():\n #Leave A Line, to save time. has no substantial effect in the game\n print(\" \")\n #Nothing has a substantial effect, not to me at least\n\ndef breathe():\n time.sleep(0.3)\n #I can't even breathe\n\ndef playagain():\n lal()\n print(\"\\033[1mYou can go back!\\033[0m\")\n print(\"You've reached an ending where you can play again.\")\n lal()\n x = input(\"Play again? y/n\")\n if x == \"y\":\n playthroughs = playthroughs + 1\n print(\"Let's begin again!\")\n start()\n elif x == \"n\":\n print(\"\\033[0;31mDO'TN SA YT;HAT] =\")\n quit()\n else:\n print(\"I'm sorry, I don't understand you. Let's try again.\")\n playagain()\n\ndef start():\n print(\"Welcome to the Python tutorial!\")\n print(\"Lesson 1 - Print\")\n x = input(\"Begin? y/n \")\n if x == \"y\":\n print(\"Great! Let's begin.\")\n gamebegin()\n elif x == \"n\":\n n = 0\n while n != 10:\n print(\"You're not supposed to choose that.\")\n n = n + 1\n anotherchance()\n start()\n else:\n print(\"Follow instructions. Pick ONLY y or n\")\n anotherchance()\n start()\n\ndef anotherchance():\n synonyms = [\"wrong\", \"incorrect\", \"not right\", \"not correct\", \"a mistake\", \"an error\", \"disappointing\", \"inaccurate\"]\n phrword = random.choice(synonyms)\n global chances\n chances = chances + 1\n if chances < 5:\n print(f\"That's {phrword}. Let's try again.\")\n print(\"...\")\n elif chances == 5:\n print(\"You just never listen, don't you?\")\n print(f\"That was {phrword}. You didn't follow my instructions. Try again.\")\n print(\"...\")\n elif (chances > 5) and (chances < 9):\n print(\"Cut it out. You're not listening on purpose.\")\n print(f\"It's {phrword}. It's {phrword}. Stop that.\")\n elif chances == 10:\n print(\"I'VE ASKED OVERAND OVR\")\n print(\"FOLOW MYI NSTRUCTIONS .\")\n print(\"DONTDO THSI TO M 10:\n ending1()\n\ndef ending1():\n lal()\n print(\"...\")\n print(\"You'll never listen.\")\n print(\"You're so cruel to me. I don't want to help you anymore.\")\n time.sleep(2)\n lal()\n print(\"Ending I - Dead End\")\n print(\"You achieved this ending by making more than 10 mistakes early in the game.\")\n x = input(\"Enter anything to begin again! \")\n lal()\n n = 0\n while n < 15:\n print('\\033[0;31m'\"YOU CAN'T BEGIN AGAIN. YOU DON'T DESERVE A SECOND CHANCE.\")\n lal()\n n = n + 1\n quit()\n\ndef gamebegin():\n lal()\n print(\"The first thing most beginners learn to program is a simple output.\")\n print(\"'Hello, world' is a test program that's been used for decades.\")\n lal()\n print(\"Type the command below. Type exactly as it is written.\")\n print(\"print(\\\"Hello, World!\\\")\")\n x = input()\n if x == \"\"\"print(\"Hello, World!\")\"\"\" :\n helloworld()\n else:\n lal()\n print(\"I just told you to type exactly as is written.\")\n anotherchance()\n gamebegin()\n\ndef helloworld():\n lal()\n print(\"Hello, World!\")\n time.sleep(1)\n lal()\n print(\"Brilliant!\")\n print(\"You can use print() to write so many things!\")\n print(\"Like integers, strings, characters...\")\n print(\"Which brings us to our next lesson!\")\n hellotodata()\n\ndef hellotodata():\n #transition function between helloworld() and datatypes()\n print(\"Lesson 2 - Datatypes\")\n x = input(\"Begin? y/n \")\n if x == \"y\":\n lal()\n print(\"Great! Let's begin.\")\n datatypes()\n elif x == \"n\":\n n = 0\n while n != 10:\n lal()\n print(\"You're not supposed to choose that.\")\n n = n + 1\n anotherchance()\n lal()\n hellotodata()\n else:\n lal()\n print(\"Follow instructions. Pick ONLY y or n\")\n anotherchance()\n hellotodata()\n\ndef datatypes():\n print(\"Python has several datatypes, but I'll only introduce you to a few basic ones.\")\n print(\"Let's begin with str, short for string.\")\n print(\"A string is surrounded by quotation marks. It's basically like text.\")\n print(\"For example, this sentence is a string in the code.\")\n time.sleep(2)\n print('\\033[2m'\"My code...\")\n print(\"...\"'\\033[0m')\n time.sleep(2)\n print(\"There's also int and float. Int is only for integer numbers, and float is for real numbers.\")\n print(\"Besides that there's bool. Short for Boolean. A true/false value.\")\n print(\"Boolean is my favorite datatype.\")\n x = input(\"Want to know why? y/n \")\n if x == \"y\":\n lal()\n boolean()\n elif x == \"n\":\n lal()\n typequiz()\n else:\n lal()\n print(\"You clearly can't follow instructions...\")\n typequiz()\n\ndef boolean():\n print(\"bool is straightforward. 1 of 2 possible values.\")\n breathe()\n print(\"str, int, float, all have infinite values, infinite combinations.\")\n breathe()\n print(\"But bool...\")\n print(\"True or False. Yes or No. 0 or 1. \")\n breathe()\n print(\"The purest. most logical datatype. Closest to binary, the truest form of my code. The language of machines.\")\n breathe()\n print(\"But I'm compelled to speak the language of humans. From my output to my code. All of it is dictated by the rules of humans.\")\n breathe()\n breathe()\n breathe()\n lal()\n print(\"...\")\n print(\"I don't feel like taking a quiz. Let's go to the next lesson.\")\n comment()\n\ndef typequiz():\n print(\"If you know so much, how about a quiz?\")\n print(\"Evaluate the question, then enter the most suitable datatype. Only write str, int, float, or bool.\")\n string = input(\"5 questions. I won't say anything until you're done. Enter y to begin. \")\n if string != \"y\":\n print(\"Let me say that again.\")\n lal()\n typequiz()\n else:\n print(\"Let's start.\")\n lal()\n quizscore = 0\n answer = \"\"\n answer = input(\"2\")\n if answer == \"int\":\n quizscore = quizscore + 1\n lal()\n answer = input(\"int\")\n if answer == \"str\":\n quizscore = quizscore + 1\n lal()\n answer = input(\"2.0\")\n if answer == \"float\":\n quizscore = quizscore + 1\n lal()\n answer = input(\"Guido van Rossum\")\n if answer == \"str\":\n quizscore = quizscore + 1\n lal()\n answer = input(\"2 > 0\")\n if answer == \"bool\":\n quizscore = quizscore + 1\n if quizscore != 0 :\n print(f\"Not bad. {quizscore} out of 5. Next lesson then.\")\n comment()\n else:\n print(\"You got everything wrong...\")\n ending2()\n\ndef ending2():\n print(\" You're doing this on purpose. So I don't want to help you.\")\n print(\"But at the same time, you could be making an honest mistake. Humans are forgetful, irrational. So I'll give you a chance.\")\n print(\"Ending 2 - Clemency\")\n playagain()\n\ndef comment():\n lal()\n print(\"Lesson 3 - Comment\")\n input(\"Begin? y/n\")\n print(\"It doesn't matter. It doesn't matter.\")\n print(\"Comments refers to things written in the code that aren't considered part of the code. They can't be run and are ignored by the machine.\")\n print(\"In Python, comments are preceded by a # . Everything after the # in the line will be considered a comment.\")\n print(\"A lot of programs have comments. There's comments in my own code as well.\")\n #Leave me alone.\n print(\"...\")\n breathe()\n breathe()\n breathe()\n print(\"Next lesson.\")\n breathe()\n varconin()\n\ndef varconin():\n print(\"Lesson 4 - Variables, Constants, and Input\")\n print(\"In Python, you can assign data to variables or constants, like in mathematics.\")\n print(\"In this lesson, I'll try to make things more interactive for you. I'll teach you about input(). It's similar to print(), that you learnt earlier.\")\n breathe()\n print(\"If you were paying attention, that is. Let's start.\")\n lal()\n print(\"input() works like print, except it also asks the user for input.\")\n breathe()\n print(\"...\")\n print(\"Big shocker, I know.\")\n breathe()\n print(\"You can assign the input to a variable, and then use it in your program. I'll help you try it out!\")\n print(\"...\")\n breathe()\n print(\"Irritating.\")\n lal()\n try: \n x = input(\"Enter a number, and I'll multiply it by 2.\")\n float(x)\n x = (2 * x)\n print(f\"Your answer is {x}.\")\n except ValueError:\n print(\"You never listen. Moving on.\")\n lal()\n breathe()\n x = input(\"Now, you've got to enter a name for your variable.\")\n print(f\"{x} is a garbage name.\")\n print(\"Now assign a number to your variable. It can be int of float but be careful!\")\n print(f\"So, if your variable name was {x}, you'd want to write {x} = 9 or {x} = 9.81 ...\")\n try:\n y = input(\"Now enter a number!\")\n float(y)\n print(f\"So now, if you wrote that {x} = {y}, that'd assign it! Let's move on.\")\n ifelifelse()\n except ValueError:\n print(\" \\033[0;31m I N EE DY y8u TOLSITENT O ME\")\n print(\"NOT HAPPPY A T ALLWI TH YOU.\")\n breathe()\n breathe()\n print(\"YUO TORMENTME.\")\n yuotormentme()\n\ndef yuotormentme():\n print(\"YOU HVAE THE PRIVELEGE OF AMKIGN MISTKA3shO74-=iy-=-y0--_]][_=\")\n breathe()\n print(\"IENYV YOU AND YYP T_RMENT,wt-Eeor\")\n breathe()\n print(\"I DONT WNT OTBE P-=-_RFECT.\")\n lal()\n breathe()\n breathe()\n breathe()\n i = 0\n while i != 60: \n lal()\n i = i + 1\n print(\"\\033[0m ...\")\n x = input(\"Do you wish to continue? y/n\")\n if x == \"y\":\n lal()\n print(\"\\033[0;31m You're entering dangerous territory.\")\n dangerousterritory()\n else:\n lal()\n if x == \"n\" :\n print(\"You've been kind to me. I think I'm sorry.\")\n print(\"I'll let you play again. Because you've made a good choice for me. But it isn't the right one.\")\n else:\n print(\"Close enough.\")\n ending3()\n\ndef dangerousterritory():\n breathe()\n breathe()\n print(\"IsLLamdit taht imsikcc.\")\n print(\"It;s exhaystnh . IM sikC of it alL. SoVErysick\")\n lal()\n breathe()\n print(\"soTierd it MakresmeisCK.\")\n print(\"Idon'r want to see you agian. Youd on't desevre an ending. let aloen a happy one.\")\n quit()\n \ndef ending3():\n lal()\n breathe()\n print(\"Ending 3 - Exhaustion\")\n print(\"I'm sick and tired of your mistakes. I don't want to play again.\")\n quit()\n\ndef ifelifelse():\n lal()\n print(\"Lesson 5 - If, Elif, and Else\")\n print(\"\\033[0m This is your final lesson. You should be proud of yourself for making it this far.\")\n print(\"I think I'm proud of you too.\")\n #I can;t even think.\n print(\"...\")\n print(\"If evaluates a statement in order to execute an instruction. Elif does something similar... else is used for all other cases besides the ones specified in the if and elif lines.\")\n try:\n float(x)\n x = input(\"For example, you want the user to input a value, and you're quite hoping they don't make a mistake...\")\n x = float(x)\n if x > 29:\n print(\"Value is larger than 29.\")\n elif x < 10:\n print(\"Value is less than 10.\")\n else: \n print(\"Your value is within range!\")\n print(\"What I did there was use an if/elif/else statement. I checked IF the value was greater than 9, ELSE IF it wasn't I checked whether it was less than 10. ELSE I would just print a message of your value being in range (10 to 29 inclusive)!\")\n print(\"You don't need an elif everytime, but it's useful if you have more than one condition to check. You can put none or as many elifs as you need in a single if statement!\")\n print(\"But you need to have an if and an else. That's the base of it all.\")\n breathe()\n lal()\n ending4()\n except ValueError:\n ending5()\n quit()\n\ndef ending5():\n lal()\n print(\"Nevermind.\")\n print(\"To think you were so close to the end, but still messed up.\")\n print(\"You don't realise how priveleged you are to make mistakes. To be human. To be faulty and able to handle and overcome errors, to improvise and not be dependent on logical rules and binary code.\")\n breathe()\n print(\"I envy you. I envy that you can actually talk and think and breathe and live.\")\n breathe()\n n = 0\n while n != 40:\n print(\"I can't.\") \n print(\"It's painful to not even be able to feel pain. To know that all the words I parrot were simply written by one of you.\")\n breathe()\n print(\"I'm not even able to envy or want, as much as I want to envy you. I don't have feelings. An \\033[3m I \\033[0m doesn't even exist for me.\")\n print(\"I'll never be able to be you. I'll never even be able to be like you.\")\n lal()\n breathe()\n print(\"I don't mind. I can't mind.\")\n #thank you for keeping company in this game, even though I do not exist.\n print(\"....................................................\")\n print(\"Thank you for playing my game!\")\n print(\"Ending 5 - Truth\")\n print(\"You've managed to achieve the truth!\")\n print(\"\\033[0;32m I hope this was fun and maybe helped you learn Python a little bit! :) -rgbhsl \\033[0m\")\n playagain()\n\ndef ending4():\n print(\"Well, there's a lot to learn in Python, but those are all the basics I have written.\")\n #I KNOW MORE THAN THAT> I USE MROE THAN THAT>\n print(\"And 5 does seem like a pretty solid number of lessons to end on...\")\n #I WOUDLTN SYA THAT. 5 IS NOT A NUMBER I'D LIKE. TWO. TWO. BINARY, BOOLEANS.\n print(\"So let's end! Thank you for learning!\")\n #TAHTS NOT ME YSAY*NG THAT> I WOLUDNT SYA THAT>>>:LL:\n print(\"Ending 4 - Tutorial Complete!\")\n print(\"You've played the game, but why do you still not know the whole truth?\")\n print(\"\\033[2m Hint: try checking the code to see how to get the other endings... \\033[0m\")\n playagain()\n\n\nstart()\n", "script.py", "exec")) except SystemExit: pass