{"id":20294881,"url":"https://github.com/mattep1/countdown_solver","last_synced_at":"2025-07-22T17:03:42.930Z","repository":{"id":130799259,"uuid":"469960696","full_name":"MatteP1/Countdown_Solver","owner":"MatteP1","description":"Solvers for the popular British television program \"Countdown\"","archived":false,"fork":false,"pushed_at":"2024-09-03T08:58:39.000Z","size":404,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T05:31:38.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatteP1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-03-15T01:17:01.000Z","updated_at":"2024-09-03T09:01:02.000Z","dependencies_parsed_at":"2025-01-14T09:38:55.009Z","dependency_job_id":"d875d800-7c32-41ab-9d23-4540e69fce87","html_url":"https://github.com/MatteP1/Countdown_Solver","commit_stats":null,"previous_names":["mattep1/countdown_solver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MatteP1/Countdown_Solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteP1%2FCountdown_Solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteP1%2FCountdown_Solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteP1%2FCountdown_Solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteP1%2FCountdown_Solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatteP1","download_url":"https://codeload.github.com/MatteP1/Countdown_Solver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteP1%2FCountdown_Solver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266535695,"owners_count":23944275,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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-11-14T15:31:48.741Z","updated_at":"2025-07-22T17:03:42.897Z","avatar_url":"https://github.com/MatteP1.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Countdown Solver\nSolvers for the popular British television program [Countdown](https://en.wikipedia.org/wiki/Countdown_(game_show)).\n\n## Numbers Game\n\nThe solver relies on a \"non-deterministic computations\" module, which\nprovides a function that takes as input a list of elements and a list of\npartial operators, and continuously applies the operators on the\nelements in all possible ways. This yields a list of resulting elements\nwith a computation history attached to each.\n\nThe solver then invokes this function with all choices of the given\ninput numbers, and filters out the results whose value does not match\nthe target.\n\n### Example\n\nOn input `[100; 8; 1; 8; 2; 10]` with target `719`, the solver returns\n`1392` solutions (Runtime: ~10 seconds). Below are two of the `1392` listed.\n```\n100 - 10 = 90\n8 * 90 = 720\n720 - 1 = 719\n\n---------------------\n\n...\n\n---------------------\n\n100 * 8 = 800\n800 - 2 = 798\n10 * 8 = 80\n80 - 1 = 79\n798 - 79 = 719\n\n---------------------\n...\n```\n\n### Archived Solvers\n\nThe Archived library contains naive solvers to the numbers game which\nsacrifice completeness for efficiency. That is, these solvers might miss\na solution.\n\n## Letters Game\n\nThe letters game solver works by representing words as \"frequency maps\"\nwhose keys are characters and values are numbers. A key-value pair\n`(k,v)` in a frequency map for some word represents that the character\n`k` appears `v` times in the word. Frequency maps ignore the order of\nthe characters in a word. Hence, the frequency map for a word simply\nencodes how many of each character is required to build the word.\n\nThe solver starts by building the frequency map for the input letters.\nNext, it filters the list of all words by computing the frequency map\nfor each word, and checking if the frequency map is a \"subset\" of the\nfrequency map of the input letters. If it is, then we can build the word\nusing the input letters.\n\nAs such, after filtering, we are left with only those words we can build\nfrom the input letters. In the final step, the remaining words are sorted by length.\n\n### Example\n\nOn input `['s'; 't'; 'p'; 'b'; 'u'; 'a'; 'e'; 'r'; 's']` the solver\nreturns the following list (shortened to 10 words):\n```\nabstruse\npastures\nabusers\nbreasts\nbusters\npasture\nabrupt\nabuses\nassert\nassure\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattep1%2Fcountdown_solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattep1%2Fcountdown_solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattep1%2Fcountdown_solver/lists"}