{"id":15595125,"url":"https://github.com/simonneutert/score-bowling-ruby","last_synced_at":"2025-03-15T04:19:06.204Z","repository":{"id":82304149,"uuid":"121618187","full_name":"simonneutert/score-bowling-ruby","owner":"simonneutert","description":"Score a game of Bowling","archived":false,"fork":false,"pushed_at":"2018-02-19T14:43:59.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T21:50:01.854Z","etag":null,"topics":["excercise","oop","ruby"],"latest_commit_sha":null,"homepage":"http://exercism.io/exercises/ruby/bowling/test-suite","language":"Ruby","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/simonneutert.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":"2018-02-15T10:47:53.000Z","updated_at":"2018-02-15T13:49:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2652ea5-c72f-406b-9fb9-9ddc1dabdedd","html_url":"https://github.com/simonneutert/score-bowling-ruby","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/simonneutert%2Fscore-bowling-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonneutert%2Fscore-bowling-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonneutert%2Fscore-bowling-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonneutert%2Fscore-bowling-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonneutert","download_url":"https://codeload.github.com/simonneutert/score-bowling-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681524,"owners_count":20330244,"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":["excercise","oop","ruby"],"created_at":"2024-10-03T00:43:03.345Z","updated_at":"2025-03-15T04:19:06.186Z","avatar_url":"https://github.com/simonneutert.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"__IT WAS BRUTAL__\n\nBut in the end, I managed to pull off a quite nifty solution, I guess.\n\n__No googling and no solution inspiration for this piece of art :smirk:__\n\n\n__To do__\n\n- some refactoring after initial commit (2018-02-15 11:36)\n\n---\n\n# Bowling\n__Score a bowling game.__\n\nBowling is a game where players roll a heavy ball to knock down pins arranged in a triangle. Write code to keep track of the score of a game of bowling.\n\n## Scoring Bowling\n\nThe game consists of 10 frames. A frame is composed of one or two ball throws with 10 pins standing at frame initialization. There are three cases for the tabulation of a frame.\n\n* An open frame is where a score of less than 10 is recorded for the frame. In this case the score for the frame is the number of pins knocked down.\n\n* A spare is where all ten pins are knocked down by the second throw. The total value of a spare is 10 plus the number of pins knocked down in their next throw.\n\n* A strike is where all ten pins are knocked down by the first throw. The total value of a strike is 10 plus the number of pins knocked down in the next two throws. If a strike is immediately followed by a second strike, then the value of the first strike cannot be determined until the ball is thrown one more time.\n\nHere is a three frame example:\n\nFrame 1 | Frame 2 | Frame 3\n--- | --- | ---\nX (strike)\t| 5/ (spare)\t| 9 0 (open frame)\n\n* Frame 1 is (10 + 5 + 5) = 20\n\n* Frame 2 is (5 + 5 + 9) = 19\n\n* Frame 3 is (9 + 0) = 9\n\nThis means the current running total is 48.\n\nThe tenth frame in the game is a special case. If someone throws a strike or a spare then they get a fill ball. Fill balls exist to calculate the total of the 10th frame. Scoring a strike or spare on the fill ball does not give the player more fill balls. The total value of the 10th frame is the total number of pins knocked down.\n\nFor a tenth frame of X1/ (strike and a spare), the total value is 20.\n\nFor a tenth frame of XXX (three strikes), the total value is 30.\n\n# Requirements\n\nWrite code to keep track of the score of a game of bowling. It should support two operations:\n\nroll(pins : int) is called each time the player rolls a ball. The argument is the number of pins knocked down.\nscore() : int is called only at the very end of the game. It returns the total score for that game.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonneutert%2Fscore-bowling-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonneutert%2Fscore-bowling-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonneutert%2Fscore-bowling-ruby/lists"}