Skip to content

Byrnetp/word-guess-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

word-guess-cli

A word guessing command-line game created using constructor functions

This command line application is a word guessing game created using two constructor functions. The first contained in letter.js can be used to create letter objects which store a letter and the status of its guess. It has one method which can either display or hide the letter it contains depending on the status of the guess as well as a method which can be used to update said status. The second constructor function in word.js creates an array of objects using the letter constructor. It also contains methods which call a user's guess on each letter and display the entire word, with only correctly guessed letters unobstructed. The index.js file then contains the logic of the game as well as the initial conditions and the word bank.

To run the game, start the index.js file in Node.js after installing the only dependency, inquirer. A word will be randomly chosen from the word bank and the user will be given 15 guesses to complete the game. Each guess should consist of one letter and it will reveal all instances of that letter in the word. Try to reveal the entire word before your guesses run out!

The game uses an astronomy-themed word bank and 15 guesses by default. However, if you would like to play using your own word bank or a custom number of guesses, simply add your own array of word strings into the wordBank variable or your own number of guesses into the remainingGuesses variable.

About

A word guessing command-line game created using constructor functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •