Project

Hangman (JavaScript)

Challenging
526 completions
~ 7 hours
4.3

With functions, loops, arrays and other variables, this is a great project for JavaScript basics. As a cherry on top, it even includes a random module. Don’t be intimidated by the number of stages; they ensure that your dive into JavaScript is safe and smooth.

Provided by

JetBrains Academy JetBrains Academy

About

Hangman is a popular yet grim puzzle game. A cruel computer hides a word from you, which you try to guess letter by letter. If you fail, you'll be “hanged”. If you win, you'll survive. You’ve probably played the game at least once or twice. Now you can actually create this game yourself!

Graduate project icon

Graduate project

This project covers the core topics of the Introduction to JavaScript course, making it sufficiently challenging to be a proud addition to your portfolio.

At least one graduate project is required to complete the course.

What you'll learn

Once you choose a project, we'll provide you with a study plan that includes all the necessary topics from your course to get it built. Here’s what awaits you:
At this stage, the player will have only one chance to guess the word. Learn how to use “Input” and “if” to implement the most basic version of the game.
Make the game more challenging! Now it will randomly choose one of four words from a list.
Enable hints in your game. Allow it to show the number of letters and the first three letters. Slicing will help you to implement this part.
Using a loop, extend the number of attempts to eight. Now we’re talking!
The outcome of the game may be “fatal”: a feature that makes the game all the more exciting. Work on implementing this feature so that players don’t lose “lives” if they guess the letter correctly. The While loop will help.
Improve the game by handling different error cases. Repetition of a letter, entering words that are too long, or using non-Latin characters shouldn’t cost your player a life.
Dinner at a restaurant starts with the menu; our project ends with one. Create a menu for your game so that players can replay it or exit.

Reviews

User 618319088 avatar
User 618319088
3 days ago
These were great learning experiences, particularly understanding how to restart a loop or break out of it.
Nahid Daúde avatar
Nahid Daúde
3 months ago
i have learned so much with this project, especially how to handle user input and organize my code so that adapts easily to changes
Vladimir Charlov avatar
Vladimir Charlov
3 months ago
I liked this one a lot of thinking, a lot of learning, and some challenging pieces.

4.3

Learners who completed this project within the Introduction to JavaScript course rated it as follows:
Usefulness
4.4
Fun
4.2
Clarity
4.3