{"id":23346703,"url":"https://github.com/dak79/odin-rock","last_synced_at":"2026-04-09T09:32:40.722Z","repository":{"id":43728556,"uuid":"446806875","full_name":"dak79/odin-rock","owner":"dak79","description":"A simple implementation of a JavaScript game","archived":false,"fork":false,"pushed_at":"2023-05-26T13:09:45.000Z","size":3046,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T19:40:43.979Z","etag":null,"topics":["css","game","git","html","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/dak79.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":"2022-01-11T12:12:32.000Z","updated_at":"2022-10-24T08:06:15.000Z","dependencies_parsed_at":"2025-02-13T19:34:13.774Z","dependency_job_id":"075acb22-4296-4962-ba71-10043568052d","html_url":"https://github.com/dak79/odin-rock","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/dak79%2Fodin-rock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dak79%2Fodin-rock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dak79%2Fodin-rock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dak79%2Fodin-rock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dak79","download_url":"https://codeload.github.com/dak79/odin-rock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694878,"owners_count":20980733,"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":["css","game","git","html","javascript"],"created_at":"2024-12-21T07:14:43.580Z","updated_at":"2025-12-30T23:05:44.744Z","avatar_url":"https://github.com/dak79.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rock Paper Scissor\n\n## Live Preview\n\n[Rock Paper Scissor](https://dak79.github.io/odin-rock/)\n\n## Description\n\nThis project is part of\n[The Odin Project - Foundations Path](https://www.theodinproject.com/lessons/foundations-rock-paper-scissors).\nThe goal of this web app is to get confident with browser console and some basic\nJavaScript, especially with functions, some logic, a bit of DOM manipulation and\na bit of event listeners. In the first stage the game was without UI and\nplayable only from console. In the second sage (adding UI) the idea was\nexperimenting with git branches and refactoring old code.\n\n## Technologies\n\n- HTML\n- CSS\n- JavaScript\n- Git\n\n## Assignment\n\n### First Stage\n\n- Start a new Git repo for your project. Create a blank HTML document with a\n  script tag. This game is going to be played completely from the console, so\n  don’t worry about putting anything else in there.\n\n- Your game is going to play against the computer, so begin with a function\n  called getComputerChoice that will randomly return either ‘Rock’, ‘Paper’ or\n  ‘Scissors’. We’ll use this function in the game to make the computer’s play.\n\n- Write a function that plays a single round of Rock Paper Scissors. The\n  function should take two parameters - the playerSelection and\n  computerSelection - and then return a string that declares the winner.\n\n- Write a NEW function called game(). Call the playRound function inside of this\n  one to play a 5 round game that keeps score and reports a winner or loser at\n  the end.\n\n- At this point you should be using console.log() to display the results of each\n  round and the winner at the end. Use prompt() to get input from the user. Read\n  the docs here if you need to.\n\n- Feel free to re-work your previous functions if you need to. Specifically, you\n  might want to change the return value to something more useful. Feel free to\n  create more “helper” functions if you think it would be useful.\n\n### Second Stage\n\n- Set up a new branch on your previous Rock Paper Scissors repo. Since we’ll be\n  making a UI for our Rock Paper Scissors game, make a new branch and change to\n  it with the command git checkout -b rps-ui.\n\n- In our UI, the player should be able to play the game by clicking on buttons\n  rather than typing their answer in a prompt. Create three buttons, one for\n  each selection. Add an event listener to the buttons that call your playRound\n  function with the correct playerSelection every time a button is clicked.\n\n- Add a div for displaying results and change all of your console.logs into DOM\n  methods.\n\n- Display the running score, and announce a winner of the game once one player\n  reaches 5 points.\n\n- Once you’re all done with your UI and made sure everything’s satisfactory,\n  commit your changes to the rps-ui branch. Now let’s take a look at how we can\n  merge the changes from our rps-ui branch back to our main branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdak79%2Fodin-rock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdak79%2Fodin-rock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdak79%2Fodin-rock/lists"}