Higher/Lower Game Project


Project Overview

The Higher/Lower Game is a simple number guessing game designed to provide a fun way for children to practice number recognition and comparison. This project demonstrates my skills in pseudocode design, input validation, decision branching, and looping constructs in programming.


Pseudocode

Python Implementation



Explanation

Project Purpose: To create an engaging and educational game for children, reinforcing concepts of number comparison through a guessing game.


Key Features:

  • Input validation to ensure the user enters valid bounds.
  • Random number generation within a user-defined range.
  • Continuous feedback on whether the guessed number is too high, too low, or correct.
  • Looping to allow multiple guesses until the correct number is found.

Testing Instructions

Steps to Test the Program:

  • Write the Code: Copy the Python implementation into a file named higher_lower_game.py.
  • Run the Code: Execute the file using the Python interpreter by running python higher_lower_game.py in the terminal.
  • Input Test Data:
    • Enter the lower and upper bounds when prompted.
    • Make guesses based on the feedback until the correct number is guessed.
  • Verify the Output: Ensure the program provides appropriate feedback for each guess (too low, too high, correct).

Testing Environment: I used PyCharm to test and debug my pseudocode and Python implementation. PyCharm’s integrated development environment (IDE) allowed me to efficiently write, run, and troubleshoot the code, ensuring it meets all specified requirements.


Example Test Run:


Tips for Testing:

  • Edge Cases: Test with edge cases like lower bound = 1 and upper bound = 2.
  • Invalid Inputs: Check how the program handles invalid inputs, such as entering a lower bound greater than or equal to the upper bound initially.
  • Repeatability: Play multiple rounds to ensure consistent feedback and correct restarting of the game.

Silvia Pizarro McCants | UX & Graphic Design Portfolio

Unsplash. (n.d.). Photo by Juanjo Jaramillo on unsplash. Unsplash.com. Retrieved June 7, 2024, from https://unsplash.com/photos/black-flat-screen-computer-monitor-mZnx9429i94

Print Friendly, PDF & Email