Python Game Collection This repository contains five small Python games that demonstrate various concepts of programming, such as loops, conditionals, and functions. Below are the details for each game:
- Bulls and Cows Game Objective: Guess a four-digit number generated by the computer, where each digit is unique. For each guess, receive feedback in the form of "bulls" and "cows."
How it Works: The computer randomly generates a unique four-digit number (e.g., 1234), where each digit is distinct. The player has 3 attempts to guess the number. For each guess: Bulls indicate the number of digits that are correct and in the right position. Cows indicate the number of correct digits that are in the wrong position. The player must guess the number within the allowed attempts.
- Word Guessing Game Objective: Guess a hidden word one letter at a time.
How it Works: The game starts by welcoming the player and prompting them to enter their name. The computer randomly selects a word from a predefined list of words. The player has 12 chances to guess the letters in the word. For each turn: The player inputs a single letter. If the input is invalid or the letter has already been guessed, the game provides feedback. If the letter is correct, it adds to the player's guessed letters. If the player runs out of chances, the game ends with a loss.
- Number Guessing Game Objective: Guess the correct number within a specified range.
How it Works: The player sets a lower and upper bound to define the range for the guessing game. The computer randomly selects a number within the specified range. The player has 7 attempts to guess the correct number. For each guess: The player is informed if the guess is "too high" or "too low." If the player guesses correctly, the game ends with congratulations. If the player runs out of attempts, the correct number is revealed.
- Harvesting Game Objective: Manage a garden by planting seeds, tending to your plants, and harvesting crops to maximize your yield.
How it Works: The player takes the role of a virtual gardener. You can: Forage for seeds: Find seeds of different plants such as tomatoes, lettuce, and carrots. Plant seeds: Select seeds from your inventory to plant. Tend to plants: Help your plants grow through various stages until they are ready to harvest. Harvest crops: Harvest plants when they are ready to yield produce.
Commands: plant: Plant seeds from your inventory. tend: Help your plants grow through their growth stages. harvest: Harvest your crops when they are ready. forage: Search for new seeds to plant. help: Display a list of valid commands. quit: Exit the game.
- Countdown Timer Objective: Create a simple countdown timer that counts down from a specified number of seconds.
How it Works: The player inputs the length of time (in seconds) for the countdown. The timer displays the remaining minutes and seconds in real-time, updating every second. The countdown continues until it reaches zero, at which point a celebratory message is displayed.
NOTICE: BOOKS FOLDER IS A WEBSCRAPPING FOLDER USING SCRAPY