GithubHelp home page GithubHelp logo

whereispolaris / node-word-guess Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 23 KB

Node CLI game that chooses a random string and lets user guess the letters until they win or run out of guesses.

JavaScript 100.00%

node-word-guess's Introduction

node-word-guess

Node CLI hangman-style game that chooses a random string and lets user guess the letters until they win or run out of guesses.

Technologies Used:

Word Guess Demo

Full Video Demo: https://santiagoenciso.com/videos/node-word-guess.mov

Installation

  • Clone repo:
$ git clone https://github.com/whereispolaris/node-word-guess.git
  • Install dependencies:
$ npm install 
  • Start the game:
$ node index.js
  • Enjoy!

node-word-guess's People

Contributors

whereispolaris avatar

Watchers

James Cloos avatar  avatar

node-word-guess's Issues

Letter Validator

When inquirer asks for a letter, check to make sure they have entered one letter.

Create Word Constructor

Contains a constructor, Word that depends on the Letter constructor. This is used to create an object representing the current word the user is attempting to guess. That means the constructor should define:

  • An array of new Letter objects representing the letters of the underlying word

  • A function that returns a string representing the word. This should call the function on each letter object (the first function defined in Letter.js) that displays the character or an underscore and concatenate those together.

  • A function that takes a character as an argument and calls the guess function on each letter object (the second function defined in Letter.js)

Assemble Index.js File

This is the file containing the logic for the course of the game, which depends on Word.js and:

Randomly selects a word and uses the Word constructor to store it

Prompts the user for each guess and keeps track of the user's remaining guesses

Letter.js should not require any other files.

Word.js should only require Letter.js

Note: Write Letter.js first and test it on its own before moving on, then do the same thing with Word.js

Note: If you name your letter's display function toString, JavaScript will call that function automatically whenever casting that object to a string (check out this example: https://jsbin.com/facawetume/edit?js,console)

Create Letter Constructor

Contains a constructor, Letter. This constructor should be able to either display an underlying character or a blank placeholder (such as an underscore), depending on whether or not the user has guessed the letter. That means the constructor should define:

A string value to store the underlying character for the letter

A boolean value that stores whether that letter has been guessed yet

A function that returns the underlying character if the letter has been guessed, or a placeholder (like an underscore) if the letter has not been guessed

A function that takes a character as an argument and checks it against the underlying character, updating the stored boolean value to true if it was guessed correctly

Project Plan

  • Read Acceptance Criteria

  • Read Acceptance Criteria Again

  • Go over Pseudo Code

  • Revise Pseudo Code

Update README

Update README file to include installation instructions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.