Git Product home page Git Product logo

javascript-hangman-lab's Introduction

JavaScript Hangman Lab

hangman

Description

You will create a CLI Hangman game. In this game, a user tries to guess a hidden phrase one letter at a time. If they guess a letter that is not in the phrase, they lose a guess. If the user uncovers the phrase before they run out of guesses, they win!

Setup

In the root directory, run the following to:

Install all the required packages

npm install

Run the test cases

npm test

Run the game

npm start 

To change the hidden message, modify the value passed into the constructor in Game.js

const readline = require('readline');
const Hangman = require('./Hangman');

readline.emitKeypressEvents(process.stdin);
process.stdin.setRawMode(true);

let hangman = new Hangman("Code Differently");

Requirements

Note: Any additional functions you write should be unit tested

  • The user starts with 6 remaining guesses
  • The user guesses one letter at a time
  • If the user guesses a letter in the hidden message, all occurances of that letter are revealed
  • If the user guesses a letter not in the hidden message, they lose a remaining guess
  • If a user loses all their remaining guesses, they lose
  • If a user reveals all of the letters in the hidden message, they win!

win

Optional

  • Modify Game.js to allow the user to enter the hidden message in the terminal before the game rather than hardcoding it in the Game.js file.
  • Prevent the user from reguessing a letter
  • Improve the console output

ui

Submission

Push your code to GitHub and create a pull request

javascript-hangman-lab's People

Contributors

kburd avatar

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.