{"id":17913714,"url":"https://github.com/stratus3d/fisher_yates_shuffle","last_synced_at":"2025-04-03T07:24:11.540Z","repository":{"id":19326940,"uuid":"22565423","full_name":"Stratus3D/fisher_yates_shuffle","owner":"Stratus3D","description":"A simple implementation of the Fisher-Yates shuffle in Erlang","archived":false,"fork":false,"pushed_at":"2014-08-15T12:52:51.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T21:13:40.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/Stratus3D.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}},"created_at":"2014-08-03T02:57:51.000Z","updated_at":"2017-03-11T22:48:19.000Z","dependencies_parsed_at":"2022-09-25T05:51:27.386Z","dependency_job_id":null,"html_url":"https://github.com/Stratus3D/fisher_yates_shuffle","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/Stratus3D%2Ffisher_yates_shuffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stratus3D%2Ffisher_yates_shuffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stratus3D%2Ffisher_yates_shuffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stratus3D%2Ffisher_yates_shuffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stratus3D","download_url":"https://codeload.github.com/Stratus3D/fisher_yates_shuffle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246953724,"owners_count":20860074,"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":[],"created_at":"2024-10-28T19:53:11.501Z","updated_at":"2025-04-03T07:24:11.523Z","avatar_url":"https://github.com/Stratus3D.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"An Implementation of the Fisher-Yates Shuffle\n=============================================\n\nStratus3D\n\n**Note: The Fisher-Yates shuffle is very inefficient in Erlang due to the lack of an \"Array\" type. I created a function (`fisher\\_yates\\_shuffle:improved\\_shuffle/1`) that provides a more efficient way of shuffling lists. Do not use `fisher\\_yates\\_shuffle:shuffle/1` for anything other than experimentation.**\n\n## Description\nA simple implementation of the Fisher-Yates shuffle in Erlang. More information on the Fisher-Yates shuffle is available here: ([http://bost.ocks.org/mike/shuffle/](http://bost.ocks.org/mike/shuffle/)). There is also a implementation of the shuffle in JavaScript in the `js/` directory.\n\n## Usage\n\nSimply run `make` to compile the source code. To try out the code on the command line run `erl -pa ebin/`. The Fisher-Yates algorithm is in the `shuffle/1` function:\n\n    1\u003e fisher_yates_shuffle:shuffle([1,2,3,4,5,6,7,8,10,a,b,c,d,e,f]).\n    [c,8,b,3,2,6,10,4,d,5,e,f,a,1,7]\n\nThe more efficient algorithm is in the `improved_shuffle/1` function:\n\n    2\u003e fisher_yates_shuffle:improved_shuffle([1,2,3,4,5,6,7,8,10,a,b,c,d,e,f]).\n    [1,c,b,f,e,3,5,4,6,8,d,7,2,10,a]\n\n## Known Issues\nNo known issues. If you see something that could be improved feel free to open an issue on GitHub ([https://github.com/Stratus3D/fisher\\_yates\\_shuffle/issues](https://github.com/Stratus3D/fisher_yates_shuffle/issues))\n\n## Contributing\nFeel free to create an issue or pull request if you see something that could be improved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstratus3d%2Ffisher_yates_shuffle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstratus3d%2Ffisher_yates_shuffle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstratus3d%2Ffisher_yates_shuffle/lists"}