{"id":15930229,"url":"https://github.com/ianstenbit/assignment4-otp-hangman","last_synced_at":"2025-08-15T23:30:59.637Z","repository":{"id":150821771,"uuid":"71181723","full_name":"ianstenbit/assignment4-otp-hangman","owner":"ianstenbit","description":"Initial non-OTP version of hangman","archived":false,"fork":false,"pushed_at":"2016-10-31T20:09:17.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":30,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T02:22:13.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":false,"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/ianstenbit.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":"2016-10-17T21:13:15.000Z","updated_at":"2023-09-05T12:35:55.000Z","dependencies_parsed_at":"2023-05-21T23:00:46.588Z","dependency_job_id":null,"html_url":"https://github.com/ianstenbit/assignment4-otp-hangman","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ianstenbit/assignment4-otp-hangman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianstenbit%2Fassignment4-otp-hangman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianstenbit%2Fassignment4-otp-hangman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianstenbit%2Fassignment4-otp-hangman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianstenbit%2Fassignment4-otp-hangman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianstenbit","download_url":"https://codeload.github.com/ianstenbit/assignment4-otp-hangman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianstenbit%2Fassignment4-otp-hangman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644764,"owners_count":24621332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"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":[],"created_at":"2024-10-07T00:40:32.578Z","updated_at":"2025-08-15T23:30:59.277Z","avatar_url":"https://github.com/ianstenbit.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hangman—The OTP iteration\n\nIt's time to take our Hangman game up a notch.\n\nThis assignment takes Hangman and turns it into a supervised set of OTP servers.\n\nWe'll be taking two modules, Game and Dictionary, and making servers of each.\n\nThese modules will be part of a supervision tree. The constraints of\nthis supervision are simple:\n\nIf the Game exits normally, do nothing. If it crashes, restart it (and just it).\n\nIf the Dictionary exits for any reason, kill any game, and restart both the\nDictionary and the Game.\n\n(Hint: you'll need two supervisors.)\n\nI need you to add a single paragraph comment to the top of\n`lib/hangman.ex` explaining why you have chosen the supervision\nstructure that you use.\n\n\n# Details for 5345 and 7345 Students\n\nConvert the current dictionary module to a GenServer inline (that is, the\ndictionary code and the GenServer api and callbacks will all be in the\ndictionary module).\n\nYou'll register the dictionary server under the name `:dictionary`.\n\nConvert the game to a GenServer using the *outside* style (so you'll\nwrite a separate GameServer module that calls functions in the\nexisting `game.ex` file. Give the GameServer a name.\n\nYou'll need to add top-level supervision to `lib/hangman.ex`, and\nyou'll need to add a second subsupervisor in `lib/hangman/...`.\n\nUpdate your `mix.exs` to start the servers automatically (by\nreferencing the top-level supervisor).\n\n\nYou'll play the game using\n\n~~~ elixir\nstatus = Hangman.GameServer.make_move(guess)\n~~~\n\nWhere status is one of `:won`, `:lost`, `:good_guess`, or `:bad_guess`.\n\nThe other API calls are\n\n~~~\nlength       = Hangman.GameServer.word_length\nletters_used = Hangman.GameServer.letters_used_so_far\nturns_left   = Hangman.GameServer.turns_left\nword         = Hangman.GameServer.word_as_string(reveal = true|false)\n~~~\n\nThese behave just like the API in assignment 2.\n\n# A Starting Point\n\nTo make my life easier, this project already has a version of the\nassignment 2 hangman game. You job is to turn `game.ex` and\n`dictionary.ex` into GenServers, and to add the appropriate supervision\ntree and support modules.\n\n# Tests\n\nYou can use `mix test` to test your code. Right now, all but one of the\ntests fail, because they are written for the OTP version of the app.\nAs you start to add functionality, more and more will pass.\n\n# Grading\n\nA total of 100 marks are available:\n\n50 for a working program (one that passes the tests included here and any\n   others I may run wile grading)\n\n10 for a good description of the supervision strategy you use, justifying\n   why it meets the requirements above\n\n20 for elegant code\n\n10 for good-looking code\n\n10 for the rest :)\n\nCopying code from other students will be penalized.\n\n\n# 8k Students\n\nYou will do the same as above, but with one small twist.\n\nYou will implement the game servers so that you can run an arbitrary\nnumber of them in parallel. To do this, the game server supervisor\nwill need to use the `simple_one_for_one` strategy, and create worker\nprocesses when requested.\n\nThe game supervisor will have a function `new_game` that starts a new\nGameServer child process and returns its pid. That child is a GenServer.\n\nYou play the game using the GameServer interface. In your case, you'll\nneed to keep the original first parameter to each call, as you'll need\nto pass the pid in.\n\nThe game process should terminate normally when the game is either won\nor lost. It won't need to be restarted.\n\nSo, a sample iex session might be:\n\n~~~\niex\u003e g1 = Hangman.GameSupervisor.new_game\niex\u003e Hangman.GameServer.make_move(g1, \"e\")\niex\u003e Hangman.GameServer.word_as_string(g1)\n\"_ _ _ e _ e\"\niex\u003e g2 = Hangman.GameSupervisor.new_game\niex\u003e Hangman.GameServer.make_move(g1, \"e\")\niex\u003e Hangman.GameServer.word_as_string(g2)\n\"e _ _ _ _ _\"\niex\u003e Hangman.GameServer.word_as_string(g1)\n\"_ _ _ e _ e\"\n~~~\n\nYou'll need to update the tests accordingly.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianstenbit%2Fassignment4-otp-hangman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianstenbit%2Fassignment4-otp-hangman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianstenbit%2Fassignment4-otp-hangman/lists"}