Tuesday, August 17, 2021

Fun With Racket: Hangman

HangMan in Racket

This project was an independent personal coding project (with GUI) undertaken by the author.   You can find the project by clicking the Github icon. ->GitHub

Author's Note


Read more about an introduction to Racket in my previous post: click here.

Concept


Hangman - an old school favourite. The goal of the game is to simply guess the letters in the word(s) or the word(s) itself. If you guess a wrong letter, the "hanged man" is drawn piece by piece, until the picture is complete. It allows for about ten incorrect guesses, though it depends from version to version.

If you've played my game, iTimeOut, you're no stranger to this game. Although it's played a little differently, it follows the same concept.

Design and Development


Starting with the basic concepts, I mapped out a simple 2-player game in Racket. One person enters the word to guess and the other person guesses. There's even a help page to indicate this.

Hangman start game screen

After entering the word and clicking start, the game begins. Clicking the letter buttons counts a guess. If the letter is in the word, it automatically displays. If not, the image is affected. 

Playing the hangman game

The second person must guess the word before the full image appears. The "image" is just a series of images that play out as you guess incorrect letters. Win or lose, your word will be displayed.

Evaluation



Racket GUI: Guess My Number

A little validation could be added to the game, checking for things like spaces and blank strings. However, the game is supposed to be simple, so the objectives were met.




0 comments:

Post a Comment




 
Loading...