2026Live
Hangman
- JavaScript
- HTML
- CSS
- Fetch API
- JSON
- Node.js Test Runner
- Vercel
Overview
A hangman game that runs in the browser, with 1,000 Turkish and 1,000 English words in 10 categories. Play with the on-screen keyboard or your own, with correct handling of Turkish letters (ı/i, ç, ğ, ö, ş, ü). It has a hint button, pre-revealed letters for long words, win streaks, a dark and light theme and screen reader support.
01 · Problem
Most hangman examples come with a short English word list. Words repeat quickly and the game cannot be played in Turkish. JavaScript's default case conversion is wrong for Turkish (it turns "I" into "i"). There is also nothing to help the player with long or hard words.
02 · Solution
I prepared validated JSON lists with 2,000 words in two languages across 10 categories, loaded with fetch only for the selected language. Words are drawn from a bag shuffled with Fisher–Yates, so nothing repeats until the category is used up. Case conversion follows the language (toLocaleLowerCase('tr')). I added a hint button that reveals a letter for a life, and long words start with one or two letters revealed. The game rules are separate from the UI and verified with unit tests. Data from files and browser storage is validated, and the site is served with security headers (CSP).
03 · Outcome
A game live at hangman.miracdeprem.com that works on phones and desktops. 21 unit tests cover the rules, all 2,000 words and storage. Even 14-letter words fit on one line on a small phone. The game uses the same theme as my portfolio site.