Ruby implementation of hangman