{"id":20409679,"url":"https://github.com/sleekpanther/set-game","last_synced_at":"2026-06-23T20:31:42.881Z","repository":{"id":115108642,"uuid":"112252389","full_name":"SleekPanther/set-game","owner":"SleekPanther","description":"Algorithm to find possible sets in the game Set using an iterative implementation of n choose 3 for combinations","archived":false,"fork":false,"pushed_at":"2017-11-28T13:22:15.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T08:50:31.110Z","etag":null,"topics":["combination","combinations","combinatorics","n-choose-k","noah","noah-patullo","noahpatullo","pattullo","pattulo","patullo","patulo","set","set-game","sets"],"latest_commit_sha":null,"homepage":"","language":"Java","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/SleekPanther.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-11-27T21:47:20.000Z","updated_at":"2022-07-01T02:51:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa5830ee-a3c1-4c4c-8d6f-b29dcd50558b","html_url":"https://github.com/SleekPanther/set-game","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SleekPanther/set-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SleekPanther%2Fset-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SleekPanther%2Fset-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SleekPanther%2Fset-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SleekPanther%2Fset-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SleekPanther","download_url":"https://codeload.github.com/SleekPanther/set-game/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SleekPanther%2Fset-game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34706579,"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-23T02:00:07.161Z","response_time":65,"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":["combination","combinations","combinatorics","n-choose-k","noah","noah-patullo","noahpatullo","pattullo","pattulo","patullo","patulo","set","set-game","sets"],"created_at":"2024-11-15T05:42:55.998Z","updated_at":"2026-06-23T20:31:42.863Z","avatar_url":"https://github.com/SleekPanther.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Set Game \nAn algorithm to find valid sets in the [Game Set](https://en.wikipedia.org/wiki/Set_(game)). This isn't a complete game, just the logic \u0026 algorithm to check if a valid set exists so that a hint can be provided.\n\n# Java Version\nThe more robust version is in [SetGame.java](SetGame.java)\n\n## Card Objects\n- The `Card` class defines a data structure to hold 4 pieces of information about a card: **number, shape, shading \u0026 color**\n- All are represented as **integers** for ease of calculation\n- Displaying a card color would just be defining some draw() method that showed a different color based on the integer value\n\n## N Choose 3 Algorithm\nWhile computationally intractable, finding all possible subsets of size 3 can be done iteratively without too much trouble\n\n- `printCombinations()` extracts the same logic from `findSets()` to find all subsets of size 3 using 3 nested loops\n- The trick to to have the inner loop start it's index at 1 greater than the parent loop's current index\n- This pattern could be continued to find combinations for specific values of **k**\n- Doesn't work for arbitrary **k** because that would likely involve a recursive implementation\n\n## Checking For Valid Sets\n- Cards have 4 attributes and each attribute must either be the same for all 3 cards, or all different\n- Since **number, shape, shading \u0026 color** are all integers, checking valid sets is done by examining each attribute and passing the 3 values to `areAllEqual(int num1, int num2, int num3)` and `areAllDifferent(int num1, int num2, int num3)`\n\n\n## Python Version\nThe 1st attempt where I came up with the n choose 3 implementation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleekpanther%2Fset-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsleekpanther%2Fset-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleekpanther%2Fset-game/lists"}