{"id":20545580,"url":"https://github.com/eonist/binarysequencer","last_synced_at":"2025-10-27T18:04:30.033Z","repository":{"id":93635048,"uuid":"276860374","full_name":"eonist/BinarySequencer","owner":"eonist","description":"🧬 Sequence all possible combination of true and false","archived":false,"fork":false,"pushed_at":"2020-07-05T14:03:04.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T15:52:46.611Z","etag":null,"topics":["algorithm","array","binary","bit","boolean","recursive","recursive-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/eonist.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":"2020-07-03T09:25:47.000Z","updated_at":"2022-01-23T04:39:59.000Z","dependencies_parsed_at":"2023-08-27T01:32:55.086Z","dependency_job_id":null,"html_url":"https://github.com/eonist/BinarySequencer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBinarySequencer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBinarySequencer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBinarySequencer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBinarySequencer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eonist","download_url":"https://codeload.github.com/eonist/BinarySequencer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242150808,"owners_count":20080006,"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","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":["algorithm","array","binary","bit","boolean","recursive","recursive-algorithm"],"created_at":"2024-11-16T01:52:42.190Z","updated_at":"2025-10-27T18:04:24.991Z","avatar_url":"https://github.com/eonist.png","language":"Swift","readme":"### Example:\n```swift\nBinarySequencer.sequence(size: 4).forEach { print($0) }\n```\n\n## Output:\n```\n[true, true, true, true]\n[true, true, true, false]\n[true, true, false, true]\n[true, true, false, false]\n[true, false, true, true]\n[true, false, true, false]\n[true, false, false, true]\n[true, false, false, false]\n[false, true, true, true]\n[false, true, true, false]\n[false, true, false, true]\n[false, true, false, false]\n[false, false, true, true]\n[false, false, true, false]\n[false, false, false, true]\n[false, false, false, false]\n```\n\n### Resources:\n\n[https://github.com/almata/Combinatorics](https://github.com/almata/Combinatorics)\n\nfor all possible combinations of letters: [https://codereview.stackexchange.com/questions/52119/calculate-all-possible-combinations-of-an-array-of-arrays-or-strings](https://codereview.stackexchange.com/questions/52119/calculate-all-possible-combinations-of-an-array-of-arrays-or-strings)\n\n```\nfunction allPossibleCases(array, result, index) {\n    if (!result) {\n        result = [];\n        index = 0;\n        array = array.map(function(element) {\n            return element.push ? element : [element];\n        });\n    }\n    if (index \u003c array.length) {\n        array[index].forEach(function(element) {\n            var a = array.slice(0);\n            a.splice(index, 1, [element]);\n            allPossibleCases(a, result, index + 1);\n        });\n    } else {\n        result.push(array.join(' '));\n    }\n\n    return result;\n}\n\nvar t1 = [\"x\", \"y\", \"z\"];\nvar t2 = [[\"a\", \"b\"], \"c\", \"d\"];\nvar t3 = [[\"a\", \"b\"], [\"c\", \"d\"], \"e\"];\n\nconsole.log(allPossibleCases(t1)); // [\"x y z\"]\nconsole.log(allPossibleCases(t2)); // [\"a c d\", \"b c d\"]\nconsole.log(allPossibleCases(t3)); // [\"a c e\", \"a d e\", \"b c e\", \"b d e\"]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feonist%2Fbinarysequencer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feonist%2Fbinarysequencer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feonist%2Fbinarysequencer/lists"}