import random
def main():
while True:
print("\nš® Mini Game Hub š®")
print("1. Snake and Ladders")
print("2. Rock Paper Scissors")
print("3. Guess the Number")
print("4. Exit")
choice = input("Pick a game (1-4): ")
if choice == '1':
snake_and_ladders()
elif choice == '2':
rock_paper_scissors()
elif choice == '3':
guess_number()
elif choice == '4':
print("See you next time!")
break
else:
print("Bruh, choose something valid.")
# Game 1: Snake and Ladders (Very Basic)
def snake_and_ladders():
print("\nš Snake & Ladders (2 Player)")
ladders = {3:22, 5:8, 11:26, 20:29}
snakes = {17:4, 19:7, 21:9, 27:1}
pos = [0, 0]
player = 0
while True:
input(f"\nPlayer {player+1}'s turn. Press Enter to roll dice.")
dice = random.randint(1,6)
print(f"You rolled: {dice}")
pos[player] += dice
if pos[player] in ladders:
print("Ladder! Up from", pos[player], "to", ladders[pos[player]])
pos[player] = ladders[pos[player]]
elif pos[player] in snakes:
print("Snake! Down from", pos[player], "to", snakes[pos[player]])
pos[player] = snakes[pos[player]]
print(f"Player {player+1} is at {pos[player]}")
if pos[player] >= 30:
print(f"\nš Player {player+1} wins!")
break
player = 1 - player # switch player
# Game 2: Rock Paper Scissors
def rock_paper_scissors():
print("\nāāā Rock Paper Scissors")
choices = ["rock", "paper", "scissors"]
while True:
user = input("Your move (rock/paper/scissors or q to quit): ").lower()
if user == 'q':
break
if user not in choices:
print("Invalid move.")
continue
comp = random.choice(choices)
print("Computer chose:", comp)
if user == comp:
print("Draw!")
elif (user == "rock" and comp == "scissors") or \
(user == "paper" and comp == "rock") or \
(user == "scissors" and comp == "paper"):
print("You win!")
else:
print("You lose!")
# Game 3: Guess the Number
def guess_number():
print("\nš¢ Guess the Number (1-100)")
num = random.randint(1, 100)
tries = 0
while True:
guess = input("Take a guess (or 'q' to quit): ")
if guess == 'q':
print(f"The number was {num}")
break
if not guess.isdigit():
print("Bruh, type a number.")
continue
guess = int(guess)
tries += 1
if guess == num:
print(f"Correct! You took {tries} tries.")
break
elif guess < num:
print("Too low.")
else:
print("Too high.")
if __name__ == "__main__":
main()