{"id":22779024,"url":"https://github.com/sinipelto/probabilitycalculator","last_synced_at":"2026-06-24T08:31:46.373Z","repository":{"id":163362167,"uuid":"127576080","full_name":"sinipelto/probabilityCalculator","owner":"sinipelto","description":"Calculates true or false (meaning event happens or not happens) with given probability of 1/n where n is user input.","archived":false,"fork":false,"pushed_at":"2018-04-01T11:27:02.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-15T18:56:35.140Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinipelto.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":"2018-03-31T22:24:21.000Z","updated_at":"2018-04-01T11:27:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"b18db4c8-8ac3-43d2-b48f-72a72579b969","html_url":"https://github.com/sinipelto/probabilityCalculator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sinipelto/probabilityCalculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2FprobabilityCalculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2FprobabilityCalculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2FprobabilityCalculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2FprobabilityCalculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinipelto","download_url":"https://codeload.github.com/sinipelto/probabilityCalculator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2FprobabilityCalculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34724735,"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-24T02:00:07.484Z","response_time":106,"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":[],"created_at":"2024-12-11T20:07:34.965Z","updated_at":"2026-06-24T08:31:46.344Z","avatar_url":"https://github.com/sinipelto.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# probabilityCalculator\nCalculates true or false (meaning event happens or not happens) with given probability of 1/n where n is user input.\n\nFunction probability(unsigned const n):\n  Input n is the factor of the probability to use with a simple formula 1/n. For example, if n = 100, function will calculate\n  true or false with probability 1/100 (which means a probability of 0.01 (1%). Any value that is \u003e= 0 and \u003c= INT_MAX may be used.\n  \n  Function generates 2 random unsigned integers between 1 and n and compares them with each other. If they do match, then the event\n  does happen (it's true, returns true), otherwise it doesn't (it's false, returns false).\n  \nIn the main function is a user interface to use this function more easily. The UI is also very easy to expand with more\ncommands if necessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinipelto%2Fprobabilitycalculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinipelto%2Fprobabilitycalculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinipelto%2Fprobabilitycalculator/lists"}