Fundamentals (Paid)
  • 🚀Course Overview
  • Course Logistics
    • 🏫Course Methodology
      • 🧩Course Components
      • 💬Community Channels
      • 🎲Course Projects
    • 💻Required Hardware and Software
      • ☝️Required Software 1
      • ✌️Required Software 2
      • 👍Recommended Setup
    • 🗓️Schedule
    • 💡Tips and Tricks
      • 📒Coding Strategies
      • 🛠️Tooling Pro Tips
    • 🎓Post-Course
      • 🎓LinkedIn Certificates
      • 🚂Bootcamp Admission Criteria
  • 1: Introduction
    • 1.1: What is Coding?
    • 1.2: Web Browsers
    • 1.3: Command Line
    • Additional Resources 1
  • 2: Basic Data Manipulation
    • 2: Operators and Expressions
      • 2.1: Arithmetic Operators | Mathematical Expressions
      • 2.2: Assignment Operators | Variables
    • 2.3: Our First Program
    • Additional Resources 2
  • 3: Structuring and Debugging Code
    • 3.1: Functions
    • 3.2: Errors
    • Additional Resources 3
  • 4: Conditional Logic
    • 4.1: Intro to Logic
    • 4.2: Pseudo-Code, Boolean Or
    • 4.3: Boolean AND, NOT
    • 4.4: Input Validation
    • Additional Resources 4
  • 5: Managing State and Input Validation
    • 5.1: Program Lifecycle and State
    • 5.2: Program State for Game Modes
    • Additional Resources 5
  • 6: Arrays and Iteration
    • 6.1: Arrays
    • 6.2: Loops
    • 6.3: Loops with Arrays
    • Additional Resources 6
  • 7: Version Control
    • 7.1: Git
    • Additional Resources 7
  • 8: GitHub
    • 8.1: Intro to GitHub
    • 8.2: GitHub Fork and Clone
    • 8.3: GitHub Pull Request
    • 8.4: GitHub Repo Browsing
    • 8.5: Deployment
    • Additional Resources 8
  • 9: JavaScript Objects
    • 9.1: JavaScript Objects
    • 9.2: Card Deck Generation with Loops
  • 10: Advanced
    • 10.1 HTML
    • 10.2: CSS
    • 10.3: The Document Object Model
    • 10.4: DOM Manipulation
    • 10.5: Advanced Debugging with Sources Tab
  • 11: POST COURSE EXERCISES
    • DOM
    • Further Readings
  • In-Class Exercises
    • Day 2: Basic File and Data Manipulation
    • Day 3: Functions
    • Day 4: If Statements, Boolean Or, Boolean And
    • Day 5: Program State
    • Day 6: Scissors Paper Stone Redux
    • Day 7: Loops
    • Day 8: Arrays and Loops
    • Day 9: Beat That Redux
    • Day 10: Moar Cards / Chat Bot
    • Day 11: Blackjack Redux, DOM
  • Projects
    • Project 1: Scissors Paper Stone
      • Project 1: Scissors Paper Stone (Part 1)
      • Project 1: Scissors Paper Stone (Part 2)
    • Project 2: Beat That!
    • Project 3: Blackjack
  • Past Projects
    • Drawing With Emojis
    • Guess the Word
Powered by GitBook
On this page
  • How to Start
  • Game Play
  • More Comfortable
  • Output Formatting
  • Easier / Harder Mode
  • Name
  • More words
  • Continue Play
  • Reference Solution
  1. Past Projects

Guess the Word

PreviousDrawing With Emojis

Last updated 2 years ago

This is a game where the player must guess a secret word.‌

Begin the app by forking this repo: ​‌

For each wrong guess the program adds to the figure: (凸 ಠ 益 ಠ)凸 ‌

The player can only guess wrong 7 times before the game ends. (the number of characters in the figure)‌

Before you start read through the advice on how to start and the more comfortable sections to see what the basic and advanced versions of the game include.‌

How to Start

The first version of this game you can have a single, hard-coded secret word- cat.‌

The data structure you need to represent the game that guesses each individual letter in a word is an array of individual letters.‌

This will allow you to guess letters and find each letter guessed and the position of those letters in the word.‌

A word array would look like this: var word = ['c','a','t'];.‌

Game Play

When the user guesses a letter, you have to have the program look through the word array and determine if the user guessed correctly. "Looking through" means looping over the word array and comparing it to the letter the user has inputted.

When the user guesses there are two possibilities:‌

  1. The user guesses incorrectly. Add a character to the figure that marks when they lose the game.

  2. The user guesses correctly, add the letter to the word they are trying to complete.

(In the first version you can just do basic output like how many guesses the user has left, and how many letters they have correct.)‌

After verifying the user guess, check for the state of the entire game:‌

If the user has guessed all the letters in the word, tell them they have won.‌

If the user has completed the figure tell them they lost.‌

More Comfortable

Output Formatting

When the user types a correct guess show the correct guess in the location of the secret word. Show the number of letters in the secret word.‌

Easier / Harder Mode

Add different modes to the game. Change the secret word to a word with the same letter more than once.‌

The easy mode is when the word is like "guess" and the user guesses 's', then the game fills in both 's'.‌

The hard mode is where the user has to guess each letter.‌

Name

Let the user enter their name at the beginning of the game.‌

More words

Add a list of words to the game. When it starts the game selects one random word.‌

Continue Play

When the user has played one game with one word, allow them to continue playing with another word.‌

Reference Solution

Please only refer to the reference solution after you have attempted the project. Thank you!‌

Note that there are many ways to implement the project and the reference solution is only 1 way.‌

​​

https://github.com/rocketacademy/basics-guess-the-word
https://github.com/rocketacademy/basics-guess-the-word/pull/5/files