This program is a simple hangman game. However, it utilizes Java methods for GUI, as well as reading and writing to files. It reads images from the Hangman files in order to progressively create the "Hangman" as more wrong guesses are taken, until the player either successfully guesses the word, or completes the hangman.
One feature of this game is that it writes the score and player for each game to a text file, as well as arranges the scores in descending order.
Another feature of the game is the words used. By default, Hangman uses a text file containing the 1000 most used words in the English language as the source for its words. If the player things that this is too easy, or would like to go with a certain theme, they can edit the text file, or even replace the text file with their own text file in the same format named "dictionary.txt". Because it is sourced from a text file as opposed to stored in the code itself, this modularity is 100% within reason.
In order to write to and update a file, it needed to first be determined how to do so. I decided that the best way to solve the issue was to read the file, add the values to an ArrayList, sort them accordingly, then erase the file and rewrite the file according to the ArrayList. However, as the scope of the project expanded, I ran into a problem of how to sort the leaderboard according to both the player score alongside the player name. This could not actually be done with a Map due to the possbility of the same player playing multiple times (A map can only hold one value to each key, therefore could a player key not hold multiple values (at least without a complicated use of ArrayLists or Arrays within a Map), but also making it complicated to display the same score multiple times (overall, it would be possible, but it would be unnecessarily complex). In order to solve this, I created a separate Player class that held a name and score value, allowing me to sort an Arraylist based on Player object scores.