docs_output_stem_override: index
mellie's epic program
this is a stupid fucking program i made to test out shitterate, my wife's epic thingy
first we need to make the file in order for it to do anything. i only know python so i will make a main.py
@target file:main.py
<< imports >>
<< main content >>
i wanted to make something slightly more complex than a hello world program so fuck it im making a number guessing game. obviously we'll need to import random so i'll do that now
@target imports
import random
now we need to set up the variables we'll be using,
@target main content
guess = 0
attempts = 0
the random number,
@target main content
number = random.randint(1,100)
and the while loop that will run the game
@target main content
while number != guess:
<< while loop >>
next we need to increment attempts by 1
@target while loop
attempts += 1
then get the player's guess
@target while loop
guess = int(input("Guess the number\n>>> "))
now we check whether their guess was bigger or smaller than the generated number
@target while loop
if guess > number:
print("Too big! Try again")
if guess < number:
print("Too small!! Try again.")
we dont need to check if they're equal because that'll be handled the next time the while loop loops. speaking of that, lets handle that now
@target main content
print(f"Well done! You managed to guess the number in {attempts} tries!! :3")