{"id":19543371,"url":"https://github.com/jonathanyiv/hangman","last_synced_at":"2026-06-15T17:31:17.226Z","repository":{"id":87536021,"uuid":"100134592","full_name":"JonathanYiv/hangman","owner":"JonathanYiv","description":"Implementation of Hangman in Ruby and Sinatra","archived":false,"fork":false,"pushed_at":"2017-09-11T08:15:13.000Z","size":1173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-18T17:23:54.526Z","etag":null,"topics":["hangman","ruby","sinatra"],"latest_commit_sha":null,"homepage":"https://infinite-river-55923.herokuapp.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JonathanYiv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-12T19:50:35.000Z","updated_at":"2017-10-01T05:59:50.000Z","dependencies_parsed_at":"2023-05-25T12:15:50.821Z","dependency_job_id":null,"html_url":"https://github.com/JonathanYiv/hangman","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JonathanYiv/hangman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanYiv%2Fhangman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanYiv%2Fhangman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanYiv%2Fhangman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanYiv%2Fhangman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonathanYiv","download_url":"https://codeload.github.com/JonathanYiv/hangman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanYiv%2Fhangman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34374144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hangman","ruby","sinatra"],"created_at":"2024-11-11T03:18:30.502Z","updated_at":"2026-06-15T17:31:17.207Z","avatar_url":"https://github.com/JonathanYiv.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hangman Project\n\nCheck out my command line version of the game [Hangman](https://en.wikipedia.org/wiki/Hangman_(game)) built with Ruby!\n\nThis is a project from [The Odin Project](https://www.theodinproject.com/courses/ruby-programming/lessons/file-i-o-and-serialization).\n\n![Hangman](/hangman.png)\n\n## Installation\n\nOpen your Terminal/Command Line. Navigate to the directory where your version will live. Type in the following:\n\n```\n$ git clone https://github.com/JonathanYiv/hangman.git\n$ cd hangman\n$ ruby game.rb\n```\n\n## Pre-Project Thoughts\n\n### Psuedo-Code\n\n1. Script displays a hangman instructions and starting screen\n2. Script loads text file and gets an array via #readlines\n3. Runs a loop to ensure word length is 5..12 then randomly selects a word\n4. Script runs a loop to prompt for guesses and check for win/lose conditions while updating the gameboard\n5. Allow serialization at any point to save/load a game\n\n### Structure\n\n```ruby\nclass Hangman\n\tinstance variables:\n\t\tgameboard\n\tmethods:\n\t\tinitialize\n\t\tplay: starts the game\n\t\t\tinstructions: prints the instructions\n\t\t\tprompt_load: determines if creating a new game or pulling serialized data for a previously saved game\n\t\t\tturns: starts the turn-taking loop while checking for win/loss conditions\n\t\t\t\tturn: prompts the player for a guess and tells the gameboard\n\t\tsave: serializes the state of the game\n\t\tload: loads a previously serialized game state to play into\nclass GameBoard\n\tinstance variables:\n\t\tsolution\n\t\tguesses: an array filled with \"_\" or the guesses\n\tmethods:\n\t\tdisplay: shows the current state of the gameboard\n\t\t\tdisplay_gallows: shows the gallows in their current state based on # of incorrect guesses\n\t\t\tdisplay_guesses: shows the addition of correct/incorrect guesses below the gallows\n\t\tupdate:\n\t\t\tevaluate_guess: takes a guess, compares it the solution, and updates the guesses array accordingly\n\t\t\tdisplay: ^see above\n```\n\n## Post-Project Thoughts\n\n1. The hardest part was probably the file serialization process. I am still relatively unfamiliar with it and hope to get more practice going forward, although I know that -- in the long run -- databases are what will matter.\n\n2. Implementing the hangman game itself was very easy; it took me about an hour.\n\n3. This project is one of several games I have created for The Odin Project, and I am especially proud of this one because I feel it divides things into smaller chunks and feels more organized than the previous few. \n\n4. If I were to add more features, I would probably have the script display a list of saved games and their respective word lengths when prompted to save/load a game. However, my desire to keep pushing foward is stronger.\n\n5. All in all, this was a fun project that was low to moderately challenging, but very exciting in terms of using serialization to 'save' the state of the game.\n\n6. ALSO, for SOME REASON, even though I changed my Sublime Text 3 Tab Settings to make a Tab equivalent to 2 Spaces, when I upload to Github, it reverts to a full tab. Update: You can change the tab settings on Github directly. I will do it for future projects.\n\n***\n\n# Hangman (Sinatra) Project\n\nCheck out my web application of the game [Hangman](https://infinite-river-55923.herokuapp.com/) built with Sinatra!\n\nThis is a follow-up project from [The Odin Project](https://www.theodinproject.com/courses/ruby-on-rails/lessons/sinatra-project).\n\n![Sinatra Hangman](/sinatrahangman.png)\n\n## Pre-Project Thoughts\n\nThe vocabulary and relationships of Sinatra are very confusing to me right now.\nI do not feel confident in my skills regarding Sinatra at the moment.\nI will still press onward though.\n\n## Post-Project Thoughts\n\n1. There are very few resources on learning Sinatra on the web. This was the [best one](https://github.com/ISS-SOA/class-SOA-repo/wiki/resource-ruby-sinatra), an outline on GitHub of a variety of resources. In addition to the provided Odin Resources, these are other resources that filled in my gaps of knowledge:\n\n\t1. [What is Rack?](http://blog.gauravchande.com/what-is-rack-in-ruby-rails) Various resources had mentioned Rack, Rack apps, Rack middleware, etc. So I wanted to know what it is. It's just a communication protocol between the server and the Ruby web application. The application respond to the 'call' method and take an environment hash as a parameter, then return an array with three elements:\n\n\t\t1. The HTTP response code.\n\n\t\t2. A Hash of headers.\n\n\t\t3. The response body, which must respond to each.\n\n2. I suffered from some strong procrastination urges during this project. I had to remind myself that breaking a large goal into a bunch of little goals is the best way to make progress.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanyiv%2Fhangman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanyiv%2Fhangman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanyiv%2Fhangman/lists"}