Giter Site home page Giter Site logo

hangman-lab's Introduction

Hangman JS

Your Task

Recreate the classic game of Hangman! Your version, however, will exist entirely in the Javascript console and/or in alert boxes.

Here's a refresher on how the game works. You can approach this however you'd like. If you need help, we've included a few hints here.

Helpful Resources

Here are some links to some methods that may help you. They are not required. You can complete this exercise without using any -- well, most -- of these.

.split

  • tl;dr: Convert string into array of characters.

.join

  • tl;dr: Convert array to string.

.prompt

  • tl;dr: Asking for user input.

.replace

  • tl;dr: Replace characters with other characters.

.includes

  • tl;dr: Check if array contains a value.

.filter

  • tl;dr: Find all elements in array that match a condition.

.match

  • tl;dr: Check if characters in a string match a regular expression.
"abc".match(/a/) // => ["a"]
"abc".match(/d/) // => null

Bonuses

Lvl. 1

  • Allow the user to play again after win/loss without refreshing the page.

Lvl. 2

  • Create a menu that shows up when you start and win/lose the game. In the below example, if the user inputs 1, the game begins. If the user inputs 3, the game closes.
Welcome to Hangman!

1. Play Game
2. Help / How To Play
3. Quit

Lvl. 3

  • Draw ASCII art to represent guesses remaining with an actual hangman. Some inspiration...
_______
|/      |
|      (_)
|      \|/
|       |
|      / \
|
|___

hangman-lab's People

Contributors

amaseda avatar robertakarobin avatar jshawl avatar mohamedrchalal avatar

Watchers

James Cloos avatar  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.