{"id":21473818,"url":"https://github.com/bell-kevin/theshellgame","last_synced_at":"2025-03-17T07:26:47.871Z","repository":{"id":43422878,"uuid":"508122407","full_name":"bell-kevin/theShellGame","owner":"bell-kevin","description":"\"The Shell Game\" involves cups upturned on a playing surface, with a ball placed underneath one of them. The index of the cups are swapped around multiple times. After that the players will try to find which cup contains the ball.  Your task is as follows. Given the cup that the ball starts under, and list of swaps, return the location of the ball at the end. Cups are given like array/list indices.  For example, given the starting position 0 and the swaps [(0, 1), (1, 2), (1, 0)]:  The first swap moves the ball from 0 to 1 The second swap moves the ball from 1 to 2 The final swap doesn't affect the position of the ball. So  swaps = [[0,1], [1,2], [1, 0]] find_the_ball(0, swaps) == 2 There aren't necessarily only three cups in this game, but there will be at least two. You can assume all swaps are valid, and involve two distinct indices.","archived":false,"fork":false,"pushed_at":"2022-07-06T22:50:05.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T16:48:35.768Z","etag":null,"topics":["code-wars","code-wars-solution"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bell-kevin.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":"2022-06-28T02:03:35.000Z","updated_at":"2022-06-28T02:04:22.000Z","dependencies_parsed_at":"2022-07-08T00:10:33.104Z","dependency_job_id":null,"html_url":"https://github.com/bell-kevin/theShellGame","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/bell-kevin%2FtheShellGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bell-kevin%2FtheShellGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bell-kevin%2FtheShellGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bell-kevin%2FtheShellGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bell-kevin","download_url":"https://codeload.github.com/bell-kevin/theShellGame/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243990679,"owners_count":20379839,"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":["code-wars","code-wars-solution"],"created_at":"2024-11-23T10:18:59.113Z","updated_at":"2025-03-17T07:26:47.851Z","avatar_url":"https://github.com/bell-kevin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# theShellGame\n\"The Shell Game\" involves cups upturned on a playing surface, with a ball placed underneath one of them. The index of the cups are swapped around multiple times. After that the players will try to find which cup contains the ball.  Your task is as follows. Given the cup that the ball starts under, and list of swaps, return the location of the ball at the end. Cups are given like array/list indices.  For example, given the starting position 0 and the swaps [(0, 1), (1, 2), (1, 0)]:  The first swap moves the ball from 0 to 1 The second swap moves the ball from 1 to 2 The final swap doesn't affect the position of the ball. So  swaps = [[0,1], [1,2], [1, 0]] find_the_ball(0, swaps) == 2 There aren't necessarily only three cups in this game, but there will be at least two. You can assume all swaps are valid, and involve two distinct indices.\n\n\n== We're Using GitHub Under Protest ==\n\nThis project is currently hosted on GitHub.  This is not ideal; GitHub is a\nproprietary, trade-secret system that is not Free and Open Souce Software\n(FOSS).  We are deeply concerned about using a proprietary system like GitHub\nto develop our FOSS project.  We have an\n[open {bug ticket, mailing list thread, etc.} ](INSERT_LINK) where the\nproject contributors are actively discussing how we can move away from GitHub\nin the long term.  We urge you to read about the\n[Give up GitHub](https://GiveUpGitHub.org) campaign from\n[the Software Freedom Conservancy](https://sfconservancy.org) to understand\nsome of the reasons why GitHub is not a good place to host FOSS projects.\n\nIf you are a contributor who personally has already quit using GitHub, please\n[check this resource](INSERT_LINK) for how to send us contributions without\nusing GitHub directly.\n\nAny use of this project's code by GitHub Copilot, past or present, is done\nwithout our permission.  We do not consent to GitHub's use of this project's\ncode in Copilot.\n\n![Logo of the GiveUpGitHub campaign](https://sfconservancy.org/img/GiveUpGitHub.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbell-kevin%2Ftheshellgame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbell-kevin%2Ftheshellgame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbell-kevin%2Ftheshellgame/lists"}