Skip to content
Matthew McQuain edited this page Dec 1, 2018 · 2 revisions

enSeven: Wonderful Word Wizard

Overview

  • Wonderful Word Wizard is a simple word guessing game, played by two users, and utilizes socket.io to connect them.
  • Requires: Inquirer and Chalk, though Chalk is just there to make the visuals more attractive.
  • Uses the inquirer module to handle user input prompts, comparing user input to predetermined values that are initially hidden from the user.
  • We use console.log and Inquirer prompts to guide the users.

Functionality

  • Words to be guessed are store in an array.
  • We split the input word and store it as a variable, giving us an easily indexed position at which to compare values.
  • An internal counter is utilized to limit our users to 10 (ten) guesses each.
  • After returning the prompt, it calls a function to compare the returned value (guess) to each index of the test array.
  • If any letters match, that array position is revealed, otherwise the counter is increased by 1 and the user is instructed to guess again.
  • If all letters are guessed correctly within the allotted number of guesses, a 'win' state is returned and the game is ended.
  • If all guesses are used up, a 'lose' state is returned and the word is revealed. In both cases, the user is presented with the option to play again.

Stretch Goals

  • Permanent Leader-boards.
  • Further expand our word category database to include multiple subjects.

Clone this wiki locally