Skip to content

CatYoung018/guess-the-word

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ˜ฒ Guess The Word Game

A pure JavaScript implementation of a word guessing game.

JavaScript CSS HTML GitHub Pages Status


๐Ÿš€ Live Demo & Visual Showcase

โ–ถ๏ธ Play the Game Here: https://catyoung018.github.io/guess-the-word/

๐ŸŽฎ Game Preview

Guess the Word Gameplay Demo

Watch the game respond to your guesses in real-time

๐ŸŽฌ See It In Action

Guess the Word Gameplay Demo

Watch the game respond to your guesses in real-time


๐ŸŽฒ How to Play

  1. A random word is selected from the word list
  2. You have 8 attempts to guess the word
  3. Enter one letter at a time using your keyboard or the on-screen buttons
  4. โœ… Correct letters appear in their positions
  5. โŒ Incorrect guesses reduce your remaining attempts
  6. Win by guessing all letters before running out of attempts!

๐Ÿ’ก Project Goal & Technical Focus

This project was developed to solidify my foundational understanding of core front-end principles.

The primary goals were:

  • Mastering the DOM: Gaining fluid control over HTML elements for dynamic UI updates without relying on a framework.
  • State Management in Vanilla JS: Implementing a clear, centralized system to track the current word, guessed letters, remaining guesses, and game status.
  • Event Delegation: Efficiently handling keyboard and on-screen button inputs using a single event listener.
  • Code Structure: Practicing modern, modular JavaScript structuring for scalability and readability.

๐ŸŽฏ Key Features

  • Responsive Layout: Fully functional and accessible across desktop and mobile screen sizes.
  • Input Validation: Notifies the user if they attempt to enter a non-letter or a letter they have already guessed.
  • Dynamic UI: The letter display, remaining attempts, and game messages update instantly with every guess.
  • Win/Loss Condition: Clear notification and visual change when the player solves the word or runs out of attempts.

๐Ÿ’ป Tech Stack

Category Technologies Used
Languages HTML5, CSS3, Vanilla JavaScript
Deployment GitHub Pages
Tools Git, VS Code

๐Ÿง  JavaScript Concepts Demonstrated

This project showcases proficiency in:

  • DOM Manipulation - Dynamic updates to HTML elements without a framework
  • Event Handling - Keyboard events and button click listeners
  • State Management - Tracking game state in vanilla JavaScript
  • Array Methods - .includes(), .split(), .join(), .map(), .filter()
  • String Manipulation - Working with letters and words
  • Conditionals & Logic - Game flow and win/loss conditions
  • ES6+ Syntax - Arrow functions, template literals, const/let
  • Input Validation - Checking for valid letters and preventing duplicates

๐Ÿ’ป Run Locally

Want to try the code yourself?

  1. Clone the repository

    git clone https://github.com/CatYoung018/guess-the-word.git
    cd guess-the-word
  2. Open in browser

    • Simply open index.html in your browser
    • Or use a local server:
    # Using Python
    python -m http.server 8000
    
    # Using VS Code Live Server extension
    Right-click index.html โ†’ Open with Live Server
  3. Start playing!


๐Ÿ“ Project Structure

guess-the-word/
โ”œโ”€โ”€ index.html          # Main game page
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ styles.css     # Game styling
โ”œโ”€โ”€ js/
โ”‚   โ””โ”€โ”€ script.js      # Game logic
โ””โ”€โ”€ img/               # Game assets

๐Ÿ“ˆ Lessons Learned & Future Plans

Working on this project was a fantastic opportunity to see how game logic translates into code. The biggest takeaways were:

  1. Immutability: I initially ran into bugs because I was directly modifying game variables. I learned to use spread syntax (...) and object copying to create new states, which made the logic much more predictable.
  2. Code Review Value: Conducting a code review highlighted areas where my DOM manipulation could be consolidated, reducing repetitive code.
  3. Refactoring for Scale: If I were to build this out further (e.g., add categories, scorekeeping), the next major step would be to organize the game logic into a Game Class for better separation of concerns and easier testing.

๐Ÿ”ฎ Future Enhancements

Ideas for v2.0:

  • Add difficulty levels (easy/medium/hard words)
  • Include hint system
  • Add score tracking and high scores
  • Implement word categories (animals, food, tech, etc.)
  • Add sound effects for correct/incorrect guesses
  • Create multiplayer mode
  • Add timer for speed challenges
  • Include daily word challenge

๐Ÿค Contributing

Contributions are welcome! If you'd like to improve the Guess the Word game:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ™ Acknowledgments

  • Skillcrush - This project was built as part of their comprehensive front-end development curriculum with guidance on JavaScript best practices and game logic
  • Built with vanilla JavaScript to demonstrate core programming fundamentals

๐Ÿ“ง Contact

Cat Young


๐Ÿ“ License

This project is open source and available for educational purposes.


๐ŸŽฎ Happy Guessing! ๐ŸŽฎ

โญ Star this repo if you enjoyed the game!

About

๐ŸŽฎ Interactive word guessing game built with vanilla JavaScript. Guess the word in 8 tries! Features DOM manipulation, event handling, and dynamic UI updates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors