File Exchange

image thumbnail


version 4.0.1 (4.2 KB) by Aidan Mackey
This is a script for a hangman game.


Updated 17 Mar 2019

View License

I just randomly used 8 quotes that are lines from movies or popular sayings as the possible puzzles. Let me know if there is any way I can improve the code!

Cite As

Aidan Mackey (2019). Hangman (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)



This is the final version!


Includes bug fixes from version 2.0.1 and reads capital letters.


The most recent update includes an option to have a friend create a puzzle for you to solve, or you can choose the option to play a randomly generated program. At this point, I need to add a function to convert the capital letters a user enters.


Added a picture to show what my code looks like


I added comments to the entire code to show what everything does thus allowing me to take out extra, unnecessary lines.


I added another puzzle with every letter in the alphabet just because I wanted to make a puzzle that was impossible to lose. My friend then typed in punctuation marks and found a way to lose so I added a catch to only recognize letters.


I added a catch feature if the user hits enter without inputting a letter first.

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor