{"id":20438714,"url":"https://github.com/anurag1101/python_guess_game","last_synced_at":"2025-06-13T14:05:27.384Z","repository":{"id":262582855,"uuid":"866095873","full_name":"Anurag1101/python_guess_game","owner":"Anurag1101","description":"A simple console-based game in Python that generates a random score between 1 and 1000 and tracks the highest score achieved, saving it to a text file for persistent storage. Play to beat your own records!","archived":false,"fork":false,"pushed_at":"2024-11-29T04:30:11.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T19:55:12.803Z","etag":null,"topics":["import","library","oops","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anurag1101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-01T16:33:11.000Z","updated_at":"2024-11-29T04:30:14.000Z","dependencies_parsed_at":"2024-11-13T07:33:56.353Z","dependency_job_id":"c1fdac89-46c8-4353-a0a3-db39380be0cb","html_url":"https://github.com/Anurag1101/python_guess_game","commit_stats":null,"previous_names":["anurag1101/python_guess_game"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2Fpython_guess_game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2Fpython_guess_game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2Fpython_guess_game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2Fpython_guess_game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anurag1101","download_url":"https://codeload.github.com/Anurag1101/python_guess_game/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241983957,"owners_count":20052789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["import","library","oops","python","python3"],"created_at":"2024-11-15T09:13:00.540Z","updated_at":"2025-03-05T07:23:16.096Z","avatar_url":"https://github.com/Anurag1101.png","language":"Python","readme":"# Python Guess Game\n\nWelcome to the **Python Guess Game!** This fun game challenges you to beat the high score by generating a random score each time you play. If you score higher than the current high score, you set a new `record!`\n\n## Table of Contents:\n\n- ### Features\n- ### Installation\n- ### Usage\n- ### How It Works\n- ### Future Improvements\n\n## Features:\n\n- **Random Score Generation:**  Each round, the game generates a random score between 1 and 1000.\n  \n- **High Score Tracking:**  The highest score is saved in main.txt and updated whenever a new high score is achieved.\n  \n- **Replay Option:**  After each round, players can choose to play again or exit the game.\n  \n- **File Handling \u0026 Error Handling:**  The game handles file reading and writing operations gracefully, ensuring a seamless experience.\n\n## Installation\n\n### Clone the repository:\n   \n    git clone https://github.com/your-username/python_guess_game.git\n\n### Navigate to the directory:\n\n    cd python_guess_game\n\n### Ensure you have `Python 3.x` installed.\n\n## Usage:\n\n1. Run the game with the following command: `python guess_game.py`\n\n2. Follow the on-screen prompts to play the game. You’ll see your score, and if it's higher than the high score, it will be saved as the new high score.\n\n## How It Works:\n\n1. **Generating a Random Score:**  The `play_game()` function generates a score between 1 and 1000 using Python's `random` module.\n\n2. **Retrieving High Score:**  The `get_high_score()` function reads the high score from `main.txt` if it exists. If the file is missing or contains invalid data, the high score defaults to 0.\n   \n3. **Saving High Score:**  When a new high score is achieved, the `save_high_score()` function updates `main.txt` with the new score.\n  \n4. **Game Loop:**  The `main()` function allows players to replay the game, asking them if they want to play another round or exit.\n\n## Future Improvements:\n\n- **Custom Scoring Range:**  Allow players to set their preferred range for `random` scores.\n  \n- **Leaderboard:**  Implement a leaderboard to display multiple high scores.\n\n- **User Profiles:**  Allow different users to maintain separate high scores.\n\n## Enjoy playing the Python Guess Game and see if you can beat the high score!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanurag1101%2Fpython_guess_game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanurag1101%2Fpython_guess_game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanurag1101%2Fpython_guess_game/lists"}