{"id":25176776,"url":"https://github.com/misaghmomenib/number-guessing-game-cpp","last_synced_at":"2026-05-03T06:31:53.241Z","repository":{"id":275260298,"uuid":"925573029","full_name":"MisaghMomeniB/Number-Guessing-Game-Cpp","owner":"MisaghMomeniB","description":"The Number Guessing Game is a simple C++ console-based application where the player tries to guess a randomly generated number within a specific range. The game provides hints such as \"Too High\" or \"Too Low\" after each incorrect guess to help the player narrow down the correct number.","archived":false,"fork":false,"pushed_at":"2025-06-13T21:03:11.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T22:18:59.420Z","etag":null,"topics":["cpp","git","number-guessing-game","open-source"],"latest_commit_sha":null,"homepage":"","language":"C++","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/MisaghMomeniB.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,"zenodo":null}},"created_at":"2025-02-01T07:25:56.000Z","updated_at":"2025-06-13T21:03:14.000Z","dependencies_parsed_at":"2025-06-13T22:28:56.011Z","dependency_job_id":null,"html_url":"https://github.com/MisaghMomeniB/Number-Guessing-Game-Cpp","commit_stats":null,"previous_names":["misaghmomenib/number-guessing-game-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MisaghMomeniB/Number-Guessing-Game-Cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FNumber-Guessing-Game-Cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FNumber-Guessing-Game-Cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FNumber-Guessing-Game-Cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FNumber-Guessing-Game-Cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MisaghMomeniB","download_url":"https://codeload.github.com/MisaghMomeniB/Number-Guessing-Game-Cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FNumber-Guessing-Game-Cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32560302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T03:21:47.309Z","status":"ssl_error","status_checked_at":"2026-05-03T03:21:43.884Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cpp","git","number-guessing-game","open-source"],"created_at":"2025-02-09T13:18:11.999Z","updated_at":"2026-05-03T06:31:53.236Z","avatar_url":"https://github.com/MisaghMomeniB.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎯 Number Guessing Game (C++)\n\nA fun and interactive **console-based number guessing game** implemented in modern C++. Ideal for beginners to learn random number generation, loops, conditionals, input validation, and basic game logic.\n\n---\n\n## 📋 Table of Contents\n\n1. [Overview](#overview)  \n2. [Features](#features)  \n3. [Tech Stack \u0026 Requirements](#tech-stack--requirements)  \n4. [Installation \u0026 Build](#installation--build)  \n5. [Usage Examples](#usage-examples)  \n6. [Code Structure](#code-structure)  \n7. [Extendability Ideas](#extendability-ideas)  \n8. [Contributing](#contributing)  \n9. [License](#license)\n\n---\n\n## 💡 Overview\n\nThis CLI game randomly selects a number (e.g., between 1–100) and challenges the player to guess it within a limited number of attempts. Feedback is provided after each guess (\"too high\"/\"too low\") to guide the player. A classic exercise to practice foundational C++ concepts. :contentReference[oaicite:1]{index=1}\n\n---\n\n## ✅ Features\n\n- 🎲 Random number generation using `rand()` seeded with current time  \n- ⏱‍♂️ Difficulty levels offering different attempt limits (e.g., Easy/Medium/Hard)  \n- 🔁 Feedback loop: informs player if guess is too high or too low  \n- 🧮 Input validation to handle non-numeric user entries  \n- 👏 Win/lose messages, with option to replay  \n- 🏅 Tracks and displays total wins and losses in a session\n\n---\n\n## 🛠️ Tech Stack \u0026 Requirements\n\n- **C++11+** compatible compiler (`g++`, `clang++`, or MSVC)  \n- Standard Headers:\n  - `\u003ciostream\u003e` for I/O  \n  - `\u003ccstdlib\u003e` and `\u003cctime\u003e` for randomization  \n  - `\u003climits\u003e` for input validation\n\n---\n\n## ⚙️ Installation \u0026 Build\n\nClone the repository and compile:\n\n```bash\ngit clone https://github.com/MisaghMomeniB/Number-Guessing-Game-Cpp.git\ncd Number-Guessing-Game-Cpp\ng++ -std=c++11 -o guess_game main.cpp\n````\n\nOr, if using CMake:\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n---\n\n## 🚀 Usage Examples\n\nRun the game with:\n\n```bash\n./guess_game\n```\n\nTypical session flow:\n\n```\nWelcome to the Number Guessing Game!\nChoose difficulty (1=Easy, 2=Medium, 3=Hard): 2\nI'm thinking of a number between 1 and 100. You have 7 guesses.\n\nEnter your guess: 50\nToo high! 6 guesses left.\n...\nCongratulations! You guessed the number in 5 attempts.\nPlay again? (y/n): y\n```\n\nTracks and displays the session's win/loss record upon exit.\n\n---\n\n## 📁 Code Structure\n\n```\nNumber-Guessing-Game-Cpp/\n└── main.cpp        # Game logic, RNG, input loop, and scoring\n```\n\nKey components:\n\n* RNG seeded with `time(0)`\n* Difficulty-level selection setting guess limits\n* Input validation using `cin.clear()` and `cin.ignore()`\n* Loop controlling guesses with feedback and replay option\n\n---\n\n## 💡 Extendability Ideas\n\n* 🔧 Add customizable range or difficulty command-line flags\n* ⏳ Integrate timer to track completion time\n* 🗃 Maintain user-specific high scores (file I/O)\n* 🎨 Add ASCII art or colorful output to enhance UX\n* 🧪 Add unit tests with frameworks like Catch2\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! To add features or enhancements:\n\n1. Fork the repository\n2. Create a feature branch (e.g., `feature/highscores`)\n3. Document and comment your code\n4. Submit a Pull Request for review\n\n---\n\n## 📄 License\n\nReleased under the **MIT License** — see `LICENSE` for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisaghmomenib%2Fnumber-guessing-game-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisaghmomenib%2Fnumber-guessing-game-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisaghmomenib%2Fnumber-guessing-game-cpp/lists"}