From 7edf93b70761d8ddb4d7bc7ea48f9fae5d05b249 Mon Sep 17 00:00:00 2001 From: Andrew Haynes Date: Mon, 31 Aug 2026 14:14:30 -0400 Subject: [PATCH] Adding Player and Game classes --- main.py | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..54d4d5d --- /dev/null +++ b/main.py @@ -0,0 +1,62 @@ +import random + + +class Player: + def __init__(self, fish_per_hour, wood_per_hour): + self.fish = 0 + self.wood = 0 + self.hours = 16 + + self.fish_per_hour = fish_per_hour + self.wood_per_hour = wood_per_hour + + # If player does not have it, all fish expires at end of day. + self.fish_preserver = False + self.boat = False + + +class Game: + def __init__(self): + self.players_found = 0 + + def improve_fishing(self, player: Player): + player.fish_per_hour += 1 + + def improve_foraging(self, player: Player): + player.wood_per_hour += 1 + + def create_fish_preserver(self, player: Player): + if (player.hours >= 8 and player.fish >= 25): + player.hours -= 8 + player.fish -= 25 + player.fish_preserver = True + + def create_boat(self, player: Player): + if (player.hours == 16 and player.wood >= 100): + player.hours -= 16 + player.wood -= 100 + player.boat = True + + def create_player_values(self, player: Player): + fish = random.randint(1, 2) + wood = 0 + if (fish == 1): + wood = 2 + if (fish == 2): + wood = 1 + + player.fish = fish + player.wood = wood + + +def main(): + running = True + while (running): + print("What do you want to spend your hours on?\n1. Fishing.\n2. Foraging.\n3. Improve Fishing.\n4. Improve Foraging.\n5. Build a preserver.\n6. Build a boat") + user_input = input() + if (user_input == "1") + print(type(user_input)) + + +if __name__ == "__main__": + main()