CowBull is a fun and interactive word guessing game, built with a combination of HTML, CSS, JavaScript, Node.js, Express, Webpack, and Babel. The game challenges players to guess a secret word within a limited number of attempts. The secret word is generated randomly, and the player receives feedback on each guess, represented as cows (correct letters in the wrong position) and bulls (correct letters in the correct position).
This project demonstrates the integration of both front-end and back-end technologies, where the front-end provides an engaging user interface and the back-end handles the generation of words and validation of guesses.
- Word Guessing: Players guess a secret word by entering letters into a grid.
- Feedback System: Feedback is provided in the form of "cows" and "bulls" to help players adjust their guesses.
- Responsive Layout: The game is fully responsive, making it playable on both desktop and mobile devices.
- Dynamic Word Generation: Words are generated dynamically via external APIs to provide a new challenge each time.
- Virtual Keyboard: Users can interact with the game using either a physical or a virtual on-screen keyboard.
- Game Rules Reference: The game includes a built-in rules modal for quick reference.
This project leverages Webpack for module bundling and Babel to ensure compatibility across modern browsers. The back-end, powered by Node.js and Express, manages API calls for word generation and validation, ensuring a seamless and dynamic gameplay experience.
Here are screenshots from the CowBull game page:
To run CowBull locally, follow these steps:
- Clone the repository to your local machine.
- Install the required dependencies.
npm install
- Create a .env file in the project root and add your API key for dictionary lookup. You can obtain an API key from dictionaryapi.com.
API_KEY=your-api-key-here
- Start the development server.
npm start
- Open your web browser and visit http://localhost:3000 to play CowBull.
Welcome to CowBull, the word-guessing game!
- Enter your guesses using either the virtual keyboard or your physical keyboard.
- Submit your guess by clicking the Enter button.
- Based on your guess:
- Cows indicate correct letters in the wrong position.
- Bulls indicate correct letters in the correct position.
- Use the feedback to refine your guesses.
- Guess the secret word before running out of attempts!
This project uses the following APIs:
- Generates a random word of a specific length to serve as the secret word.
- The Dictionary API is used to check if a word is valid and in the dictionary.
- Requires an API key, which you can obtain from dictionaryapi.com and store it in your .env file as API_KEY.