zsmb's prog site

Mean Hangman

  2015.01.26.

Introduction

This was also one of the choices we had for our homework for our programming subjects this semester, the twist from the classic hangman game is that the computer doesn't choose one random word at the beginning of the game, but makes the instead keeps a list of all words that could fit the bits that the player has guessed that far.

Description

The computer "cheats" by eliminating the words from its list that contain the letters guessed by the player, as long as it can do it. It also chooses to keep the words that contain the player's guess the fewest times, and if the player guesses a letter that's present in all words on its list, it lays down the letter into the spot where it fits most of the remaining words.

There is a (fairly hard to guess) cheat built into the game that lets you display the list of words that the computer has while playing.

The game works with two languages right now, English and Hungarian, for which the word lists are included in the downloads below. You can also add your own words to the list, that was part of the assignment.

Development

This project got a bit out of hand in the making. I first made it without the graphics that it now has, and added all that later. As a result, I didn't manage to clean up the source code to a presentable form (at least not yet). Therefore, the download provided below is only for the finished executable game.

I'm also aware that there is still a tiny little bug that sometimes doesn't display all found letters, but it's rare enough that I decided to put off fixing it.

This was also my first run at rendering fonts using the SDL library, which turned out to be fairly convenient.

Downloads

Downloading the zip file that contains the executable results in a warning (at least in Chrome) as a security measure, but you can choose to "Keep" it.

Name Description Size Date
hangman.zip Contains everything you need to play the game 893 KB 2015.01.26.