This commit is contained in:
Tucker 2024-03-11 20:05:37 -04:00
commit 16d875d3e3
13 changed files with 300 additions and 0 deletions

View File

@ -0,0 +1,35 @@
print("Welcome to the Forest Adventure Game!")
# Start of the game
print("You find yourself on the edge of a dark forest.")
print("Can you find your way through without getting lost?")
print("You see a path to your left and right.")
choice = input("Do you want to go left or right? (left/right) ")
# Decision making
if choice == "left":
print("You decide to go left and encounter a bear.")
action = input("Do you want to run or stay? (run/stay) ")
if action == "run":
print("You ran as fast as you could and safely made it out of the forest. You win!")
elif action == "stay":
print("You stayed calm. The bear sniffed you and walked away. You safely walk out of the forest. You win!")
else:
print("You didn't choose a valid action. The bear got confused and left. You safely walk out of the forest. You win by luck!")
elif choice == "right":
print("You go right and find a magical pond. A fairy offers you two potions: red and blue.")
potion = input("Which potion do you choose? (red/blue) ")
if potion == "red":
print("You drink the red potion and gain the strength of a bear. You confidently stroll out of the forest. You win!")
elif potion == "blue":
print("You drink the blue potion and gain the ability to fly. You fly out of the forest. You win!")
else:
print("You didn't choose a potion and the fairy turns you into a frog. Game over.")
else:
print("You didn't choose a valid path and got lost in the forest. Game over.")
print("Thank you for playing the Forest Adventure Game!")

View File

@ -0,0 +1,34 @@
import random
# Generate a random number between 1 and 100
secret_number = random.randint(1, 100)
print("Welcome to the Two-Player Number Guessing Game!")
print("I'm thinking of a number between 1 and 100.")
player1_name = input("Player 1, enter your name: ")
player2_name = input("Player 2, enter your name: ")
# Set the number of attempts
attempt = 0
while True:
attempt += 1
# Players take turns guessing
if attempt % 2 != 0:
print(f"{player1_name}'s turn.")
else:
print(f"{player2_name}'s turn.")
guess = int(input("Make a guess: "))
if guess < secret_number:
print("Too low. Try again.")
elif guess > secret_number:
print("Too high. Try again.")
else:
if attempt % 2 != 0:
winner = player1_name
else:
winner = player2_name
print(f"Congratulations, {winner}! You have guessed the number correctly. It was {secret_number}.")
break

51
ChatGPT Tic Tac Toe.py Normal file
View File

@ -0,0 +1,51 @@
def print_board(board):
for row in board:
print("|".join(row))
print("-" * 5)
def check_win(board, player):
win_conditions = [
[board[0][0], board[0][1], board[0][2]],
[board[1][0], board[1][1], board[1][2]],
[board[2][0], board[2][1], board[2][2]],
[board[0][0], board[1][0], board[2][0]],
[board[0][1], board[1][1], board[2][1]],
[board[0][2], board[1][2], board[2][2]],
[board[0][0], board[1][1], board[2][2]],
[board[2][0], board[1][1], board[0][2]]
]
return [player, player, player] in win_conditions
def get_player_move(player):
while True:
try:
move = int(input(f"Player {player}, enter your move (1-9): ")) - 1
if move < 0 or move > 8:
raise ValueError
if board[move // 3][move % 3] != " ":
print("This space is already taken.")
continue
return move
except ValueError:
print("Invalid input. Please enter a number between 1 and 9.")
def play_game():
for turn in range(9):
player = "X" if turn % 2 == 0 else "O"
print_board(board)
move = get_player_move(player)
board[move // 3][move % 3] = player
if check_win(board, player):
print_board(board)
print(f"Player {player} wins!")
return
print_board(board)
print("It's a tie!")
# Initialize the game board
board = [[" " for _ in range(3)] for _ in range(3)]
# Start the game
play_game()

11
Gamertag.py Normal file
View File

@ -0,0 +1,11 @@
player_gamertag = input("print please enter you gamer tag")
awnser = input(f"so your gamer tag is {player_gamertag}? (yes/no) ")
if awnser == 'yes':
print("Great, then let's begin")
elif awnser == 'no':
print("Oh ok let's try again")
player_gamertag = input("Please enter your gamer tag: ")
else:
print("sorry I only accept yes or no as an awnser")

13
Newest.py Normal file
View File

@ -0,0 +1,13 @@
import pyxel
pyxel.init(160, 120)
def update():
if pyxel.btnp(pyxel.KEY_Q):
pyxel.quit()
def draw():
pyxel.cls(0)
pyxel.rect(10, 10, 20, 20, 11)
pyxel.run(update, draw)

9
Test/Test 2.py Normal file
View File

@ -0,0 +1,9 @@
# Ask the user for a number
number = int(input("Enter a number: "))
# Multiply the number by 2
result = number * 2
# Print the result
print("The number multiplied by 2 is: " + str(result))
print(f"The number multiplied by 2 is: {result}")

10
Test/Test.py Normal file
View File

@ -0,0 +1,10 @@
user_name = input("What is your name? ")
print("Hello, " + user_name + "!")
age = int(input("How old are you? "))
if age >= 13 and age <= 19:
print("You are a teenager!")
elif age == 20:
print("You are 20, not a teenager anymore!")
else:
print("You are not a teenager.")

25
Test/Try/Try.py Normal file
View File

@ -0,0 +1,25 @@
import random
# The fish is hiding in a randomly chosen pond between 1 and 5
fish_pond = random.randint(1, 5)
print("Welcome to FindFish!")
print("A fish is hiding in one of five ponds, numbered 1 through 5. You have three guesses to find it.")
# The player has three attempts
for attempt in range(1, 4):
guess = int(input("Guess which pond the fish is hiding in (1-5): "))
if guess < 1 or guess > 5:
print("Please choose a pond between 1 and 5.")
elif guess < fish_pond:
print("Try guessing a higher pond number.")
elif guess > fish_pond:
print("Try guessing a lower pond number.")
else:
break # This exits the loop if the guess is correct
if guess == fish_pond:
print(f"Congratulations! You found the fish in pond {fish_pond} on attempt {attempt}!")
else:
print(f"Sorry, you did not find the fish. It was in pond {fish_pond}.")

6
Test/Try/Try2.py Normal file
View File

@ -0,0 +1,6 @@
user_grades=input("print what is your grade in math?")
if user_grades >="90":
print ("good job")
elif user_grades <="50":
print ("work on MATH!")

1
Test/Try/Try3.py Normal file
View File

@ -0,0 +1 @@
input("https://www.youtube.com/watch?v=dQw4w9WgXcQ")

32
Tucker/999.py Normal file
View File

@ -0,0 +1,32 @@
import random
print("Hello welcome to test!")
Player1 = input("Enter player 1's name:")
print(f"Hello {Player1}")
Player2 = input("Now enter player 2's name:")
print(f"Hello {Player2}")
number = random.randint(1,100)
attempt = 0
while True:
attempt +=1
if attempt % 2 != 0:
print(f"{Player1}'s turn.")
else:
print(f"{Player2}'s turn")
guess = int(input("make a guess:"))
if guess < number:
print("Too low. Try again.")
elif guess > number:
print("Too high. Try again.")
else:
if attempt % 2 != 0:
winner = Player1
else:
winner = Player2
print(f"congralts {winner} the number was {number}. YOU WIN!!!!")
break

View File

@ -0,0 +1,26 @@
from matplotlib import pyplot as plt
import numpy as np
# List of NFL 99 overall players in Madden 24 (as an example, names might need updating based on the actual roster)
players_99 = [
"Patrick Mahomes",
"Aaron Donald",
"Davante Adams",
"T.J. Watt",
"Travis Kelce",
"Jalen Ramsey",
"Myles Garrett",
"Tyreek Hill"
]
# Generating colors
colors = plt.cm.rainbow(np.linspace(0, 1, len(players_99)))
# Creating the pie chart
fig, ax = plt.subplots()
ax.pie([1] * len(players_99), labels=players_99, autopct='%1.1f%%', startangle=90, colors=colors)
ax.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
# Display the wheel
plt.title("NFL 99 Overall Players in Madden 24")
plt.show()

47
Tucker/Path game.py Normal file
View File

@ -0,0 +1,47 @@
print("You are walking down a road. There is a fork in the road one path leads to the entrance of a cave. the other leads to the enterance of a forest.")
path = input("Which way do you go? (cave/forest)")
while path != "cave" or path != "forest":
if path == "forest":
print("You decide to got to the forest enterance")
forest_chioce = input("You enter the forest and see a cub. What do you do (run/investigate)")
if forest_chioce == "run":
print("you run out of the forest returning home, safe but never knowing what happpened to the cub. THE END :( ")
elif forest_chioce == "investigate":
cub_chioce = input("you are unable to find the cubs mother. it seems to have been abandoned. What do you do? (care for it/leave it)")
while cub_chioce != "care for it" and cub_chioce != "leave it":
if cub_chioce == "care for it":
cub_name = input("you take the cub home. What will you name it?:")
print(f"you and {cub_name} live a happily ever after. THE END")
exit()
elif cub_chioce == "leave it":
print("you return home out of the forest never knowing what happened to the cub. THE END")
exit()
else:
print("sorry I do not accept that option.")
elif path == "cave":
print("You decide to enter the cave")
cave_path = input("there are two tunnels left and right wich way do you go? (left/right)")
if cave_path == "left":
cave_chioce1 = input("You find a group of snakes. do you try to sneak out or play dead? (sneak out/play dead)")
while cave_chioce1 != "sneak out" or cave_chioce1 != "play dead":
if cave_chioce1 == "sneak out":
print("You try to quitly sneak out and succeed. You then run home and are greeted with safety. THE END")
exit()
elif cave_chioce1 == "play dead":
print("You try to play dead, but the snakes notice and kill you. THE END")
exit()
else:
print("I do not accept that as an option.")
elif cave_path == "right":
cave_choice2 = input("You find a group of sleeping wolves! What do you do? (Sneak out/Play dead)")
while cave_choice2 != "Sneak out" or cave_choice2 != "Play dead":
if cave_choice2 == "Sneak out":
print("You try to sneak out, but you trip over a stone! The wolves then wake up and devour you. THE END")
exit()
elif cave_choice2 != "Play dead":
print("You play dead and when the wolves wake up they don't notice you allowing you to exscape and return home to safety. THE END")
exit()
else:
print("Sorry that is not an option.")
else:
print("Sorry, but that is not a given option.")