{"id":18386244,"url":"https://github.com/bethropolis/rockpaperscissorsjs","last_synced_at":"2025-08-27T09:42:59.344Z","repository":{"id":55840472,"uuid":"317305257","full_name":"bethropolis/rockPaperScissorsjs","owner":"bethropolis","description":"ready made package to help you with your rock paper scissors project","archived":false,"fork":false,"pushed_at":"2024-01-03T21:00:32.000Z","size":1204,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-23T19:29:35.393Z","etag":null,"topics":["game","javascript-game","javascript-library","library","package","rock-paper-scissors"],"latest_commit_sha":null,"homepage":"https://bethropolis.github.io/rockPaperScissorsjs","language":"JavaScript","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/bethropolis.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":"2020-11-30T18:02:09.000Z","updated_at":"2023-03-07T01:10:14.000Z","dependencies_parsed_at":"2024-12-24T07:14:42.542Z","dependency_job_id":"dd1c8993-469d-4a15-a32a-caea17e9f4f1","html_url":"https://github.com/bethropolis/rockPaperScissorsjs","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"c8e9a3be3cf8b669b6cc981345c111907e71eb55"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bethropolis/rockPaperScissorsjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2FrockPaperScissorsjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2FrockPaperScissorsjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2FrockPaperScissorsjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2FrockPaperScissorsjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bethropolis","download_url":"https://codeload.github.com/bethropolis/rockPaperScissorsjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2FrockPaperScissorsjs/sbom","scorecard":{"id":235196,"data":{"date":"2025-08-11","repo":{"name":"github.com/bethropolis/rockPaperScissorsjs","commit":"49b01fe55d206f4d6d264cc2e32dee25b7b442b4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T05:33:16.993Z","repository_id":55840472,"created_at":"2025-08-17T05:33:16.993Z","updated_at":"2025-08-17T05:33:16.993Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272315617,"owners_count":24912613,"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":"2025-08-27T02:00:09.397Z","response_time":76,"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":["game","javascript-game","javascript-library","library","package","rock-paper-scissors"],"created_at":"2024-11-06T01:21:08.567Z","updated_at":"2025-08-27T09:42:59.034Z","avatar_url":"https://github.com/bethropolis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RockPaperScissorsJS\n---\n\n## Table of content\n* [intro](#intro)\n* [getting started](#getting-started)\n  * [roll](#roll)\n  * [compute](#compute)\n  * [won](#won)\n* [extras](#extras)\n* [License](#license) \n\n\n\n## intro\n---\nRockPaperScissorsJS is a javascript library that simplifies the making of the great rock paper scissors game and easy to use. \n\u003cp\u003e the package is madein a Javascript class format where your \u003cb\u003eplay\u003c/b\u003e will be considered an object\u003c/p\u003e\nHere is an example:\n\n```js \n  const player = new Play(); \n  //this creates a new object player and the action must be passed as an argument\n\n\n console.log(player.Roll('paper'));  \n //the three actions are users guess which could be `rock`,`paper` or `scissors`\n //the Roll() function assigned is where everything is done mostly.\n ```\n\nthe response or display on the console:\n\n   ```js\n   [\n      user: 'paper',\n      computer: 'scissors',\n      won: true\n   ]\n   ```\n   \n\n   in the above the user placed `paper` which we see from the argument passed on `new play('paper')` and the computers guess is randomly generated and\n   from the result we get that paper loses to scissors and hence the result brings `false` meaning the user lost, incase of a win it would be `true` and incase of draw it would be `draw`.\n  \n## getting started\n---\ngetting started you will first require the library which can be done by using the script tags\n\n```html\n   \u003cscript src=\"./path/to/rockPaperScissors.JS\"\u003e \u003c/script\u003e // get the library from the path where it's located\n```\nif you are using a CDN then you can use the following\n```html\n   \u003cscript src=\"https://cdn.jsdelivr.net/npm/rockpaperscissorsjs@1.5.0/rockPaperScissors.min.js\"\u003e\u003c/script\u003e \n\n```\n\nyou can also install using nodejs by running.\n\n```bash\nnpm install rpsjs\n```\n\n\u003e You can use import in node.js and other runtimes.\n\n```js\nconst Play = require('rpsjs');\n\n// create a new Play object and set rounds to play to 10.\nconst game = new Play(10);\n\n// use the game object to play Rock, Paper, Scissors\nconst result = game.Roll(\"rock\");\nconsole.log(result);\n```\n\n\u003e place the CDN link onto the header \n\u003cbr\u003e \n\nthen create an object to use\n```js\n    const player = new Play(...rounds=10, ...user=\" \");// you can name it anything other than player\n\n````\n\u003e you can find the demos [here](https://bethropolis.github.io/rockPaperScissorsJS)\u003cbr\u003e\n\n### using the functions\nthere are three functions; \n```js\n       Roll(user)\n       Compute()\n       Won(user, computer)\n       Multiplayer(user,computer)\n       Scores() // get users scores\n       Clear() // clear scores and plays\n```\n\n\u003e Note that the functions begin with a capital letter.\n\n### Roll\n\nfrom the above example you can see that the `Roll()` function did everything for us without us doing anything.\nthe `Roll()` function requires no parameters if you stated it when making the Object.\u003cbr\u003e\nExample 1:\n```js\n  const player = new Play(10);\n  console.log(player.Roll('paper'));// passing user guess to roll function (recommended)\n\n```\nExample 2:\n```js\n\n const player = new Play(10,'rock');// user guess in this case is rock\n  console.log(player.Roll());// since user guess was passed on the object there is no need to redo that again\n``` \n\u003cbr\u003e\nExample 1 output could be:\n\n```js\n    [\n       user: rock,\n       computer: scissors,\n       won: true,\n       uscore: 1,\n       cscore: 0\n    ]\n```\n\nExample 2 output could be:\n\n```js\n    [\n       user: paper,\n       computer: paper,\n       won: draw,\n       uscore: 0,\n       cscore: 0\n    ]\n```\n\u003e the computer guess is randomly made.\n\n\n\n### Compute\n---\n  the `compute()` function will help you if you would like to get a random guess for the computer.\u003cbr\u003e\n  Example:\n  ```js\n  const player = new Play();\n  let button = document.getElementById('computer-guess');\n  button.addEventListener('click', function(){\n      console.log('The computer guess is: '+player.Compute());\n  })\n\n  ```\n\n  Example of output:\u003cbr\u003e\n  ` The computer guess is: rock`\n\u003cbr\u003e\n\nyou can do a lot more with this just check the examples [here](https://bethropolis.github.io/rockPaperScissorsJS)\u003cbr\u003e\n\n### won\n  ```js    \n         Won(user, computer)          \n  ```\n   This function determines the winner where the data passed \u003cbr\u003e\n   required arguments are `user` and `computer` guess or trows eg. `rock` or `paper` or `scissors`\u003cbr\u003e\n \u003cbr\u003e\n \n   it will to be like\n  ```js\n        player.Won('rock','scissors')// user= rock and computer=scissors\n        player.Won('paper','paper')// user= paper and computer=paper\n        player.Won('scissors','rock')// user=scissors  and computer=rock\n  ```\n\nExample:\n```js\n     const player = new Play();\n\n        console.log(player.Won('rock','scissors'))// user= rock and computer=scissors\n        console.log(player.Won('scissors','scissors'))// user= scissors and computer=scissors\n        console.log(player.Won('scissors','rock'))// user=scissors  and computer=rock \n```\noutput:\n```js\n       true\n       draw\n       false\n```\n\n\n \n## extra\n---\nthis are just some extras \n* you can clone this on [github](https://github.com/bethropolis/rockPaperScissorsJS) and if you would like to Contribute you can send  a pull request and I will check it out and see if I can marge it. \n* creator [bethropolis](https://github.com/bethropolis);\n\n## License \n---\nLicensed under my favourate License, [MIT License](./LICENCE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethropolis%2Frockpaperscissorsjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbethropolis%2Frockpaperscissorsjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethropolis%2Frockpaperscissorsjs/lists"}