Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kishanlalchoudhary/guess-word-game
A console-based word-guessing game built with Ruby. The game challenges players to guess a hidden word within a limited number of attempts while providing real-time feedback on their progress. Developed using the Test-Driven Development (TDD) methodology with RSpec for rigorous testing.
https://github.com/kishanlalchoudhary/guess-word-game
rspec ruby
Last synced: 8 days ago
JSON representation
A console-based word-guessing game built with Ruby. The game challenges players to guess a hidden word within a limited number of attempts while providing real-time feedback on their progress. Developed using the Test-Driven Development (TDD) methodology with RSpec for rigorous testing.
- Host: GitHub
- URL: https://github.com/kishanlalchoudhary/guess-word-game
- Owner: kishanlalchoudhary
- Created: 2025-01-25T05:04:41.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2025-01-26T07:09:08.000Z (8 days ago)
- Last Synced: 2025-01-26T09:17:14.983Z (8 days ago)
- Topics: rspec, ruby
- Language: Ruby
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Guess Word Game ๐ฎ
A console-based word-guessing game built with Ruby. The game challenges players to guess a hidden word within a limited number of attempts while providing real-time feedback on their progress. Developed using the **Test-Driven Development (TDD)** methodology with RSpec for rigorous testing.
## Features ๐
- **Interactive Gameplay**: Guess a word letter by letter with progress shown after every guess.
- **Dynamic Word Selection**: The game can randomly choose from a predefined list of words or allow a custom word.
- **Limited Attempts**: Players must guess the word within a set number of tries.
- **Real-Time Feedback**: Correctly guessed letters are revealed, while incorrect guesses reduce the remaining attempts.
- **Test-Driven Development**: Designed and implemented using RSpec for robust and reliable code.## Gameplay Instructions ๐น๏ธ
1. Clone the repository to your local machine.
2. Run the game script to start the game.
3. Follow the prompts to guess letters for the hidden word.
4. Continue guessing until you either guess the word or run out of attempts.## Getting Started ๐ ๏ธ
### Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/GuessWordGame.git
```
2. Navigate to the project directory:
```bash
cd GuessWordGame
```
3. Install dependencies:
```bash
bundle install
```### Running the Game
To play the game, run the following command:
```bash
ruby game.rb
```### Running Tests
To ensure all tests pass, execute:
```
rspec
```## Project Structure ๐
```
GuessWordGame/
โโโ lib/
โ โโโ game.rb # Contains the main class and game logic
โโโ spec/
โ โโโ game_spec.rb # RSpec tests to validate game logic and functionality
โ โโโ spec_helper.rb # RSpec configuration and setup
โโโ start.rb # Entry point to start the game
โโโ Gemfile # Lists project dependencies and Ruby versions
โโโ README.md # Project documentation and setup instructions
```## Test-Driven Development ๐งช
This project follows TDD principles with tests written in RSpec to validate game functionality. Key tests include:
- Validating word selection and hidden word display.
- Ensuring correct handling of guesses (correct and incorrect).
- Managing game over conditions (win or lose).
- Testing edge cases such as invalid input.Thank you for checking out **GuessWordGame**! Have fun guessing! ๐