{"id":35817084,"url":"https://github.com/eminmuhammadi/randomchance","last_synced_at":"2026-01-07T17:00:11.429Z","repository":{"id":48916524,"uuid":"266197506","full_name":"eminmuhammadi/RandomChance","owner":"eminmuhammadi","description":"Randomizer with Percentages (Javascript)","archived":false,"fork":false,"pushed_at":"2021-07-05T20:15:01.000Z","size":4630,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-01T16:11:30.266Z","etag":null,"topics":["js","randomizer","roulette","roulette-wheel-algorithm"],"latest_commit_sha":null,"homepage":"https://eminmuhammadi.github.io/RandomChance/example/","language":"HTML","has_issues":false,"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/eminmuhammadi.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":"2020-05-22T20:04:05.000Z","updated_at":"2024-05-01T16:11:30.267Z","dependencies_parsed_at":"2022-09-24T00:01:52.738Z","dependency_job_id":null,"html_url":"https://github.com/eminmuhammadi/RandomChance","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eminmuhammadi/RandomChance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eminmuhammadi%2FRandomChance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eminmuhammadi%2FRandomChance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eminmuhammadi%2FRandomChance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eminmuhammadi%2FRandomChance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eminmuhammadi","download_url":"https://codeload.github.com/eminmuhammadi/RandomChance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eminmuhammadi%2FRandomChance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28236366,"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":"2026-01-07T02:00:05.975Z","response_time":58,"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":["js","randomizer","roulette","roulette-wheel-algorithm"],"created_at":"2026-01-07T17:00:08.819Z","updated_at":"2026-01-07T17:00:11.417Z","avatar_url":"https://github.com/eminmuhammadi.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RandomChance\nRandomizer with Percentages. For DEMO =\u003e [https://eminmuhammadi.github.io/RandomChance/example/index.html](https://eminmuhammadi.github.io/RandomChance/example/index.html)\n\n## Installing\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/eminmuhammadi/RandomChance@v1.0.0/dist/RandomChance.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\n## Example\nCode:\n```js\n    var Chest = \n    {\n      items:   ['diamond','gold','iron','coal','stone'],\n      chances: [3,7,15,25,50]\n    }\n    var RC = new RandomChance(Chest.items,Chest.chances);\n    var Result = RC.Spin();\n    \n    console.log(Result);\n```\nResult:\n```\nstone\n```\n\n## Chances Example\nCode:\n```js\n    var Chest = \n    {\n      items:   ['diamond','gold','iron','coal','stone'],\n      chances: [3,7,15,25,50]\n    }\n    var RC = new RandomChance(Chest.items,Chest.chances);\n    console.log(RC.LookThrough());\n```\nResult:\n```js\n(5) [Array(2), Array(2), Array(2), Array(2), Array(2)]\n0: (2) [\"diamond\", 3]\n1: (2) [\"gold\", 7]\n2: (2) [\"iron\", 15]\n3: (2) [\"coal\", 25]\n4: (2) [\"stone\", 50]\nlength: 5\n__proto__: Array(0)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feminmuhammadi%2Frandomchance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feminmuhammadi%2Frandomchance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feminmuhammadi%2Frandomchance/lists"}