{"id":17070562,"url":"https://github.com/oakmac/calculate-tournament-results","last_synced_at":"2025-05-07T10:15:03.968Z","repository":{"id":66970557,"uuid":"86278100","full_name":"oakmac/calculate-tournament-results","owner":"oakmac","description":"A programming puzzle using higher-order functions.","archived":false,"fork":false,"pushed_at":"2018-10-30T19:04:07.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T10:14:51.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oakmac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-03-27T01:28:58.000Z","updated_at":"2025-03-08T10:54:39.000Z","dependencies_parsed_at":"2023-02-25T11:00:17.434Z","dependency_job_id":null,"html_url":"https://github.com/oakmac/calculate-tournament-results","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/oakmac%2Fcalculate-tournament-results","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fcalculate-tournament-results/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fcalculate-tournament-results/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fcalculate-tournament-results/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oakmac","download_url":"https://codeload.github.com/oakmac/calculate-tournament-results/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856558,"owners_count":21814858,"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":[],"created_at":"2024-10-14T11:32:14.762Z","updated_at":"2025-05-07T10:15:03.941Z","avatar_url":"https://github.com/oakmac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calculate Tournament Results in JavaScript\n\n\u003e This is a bonus assignment. Complete it at your own pace.\n\nThe 2016 and 2017 Houston Indoor Ultimate Tournaments were a roaring success!\nTeams from all over the state battled it out on an indoor field and much fun was\nhad by all.\n\nDarren the statistician wants to calculate metrics about how teams performed in\norder to analyze the upcoming club tournament season. The tournament director\nwants to see how all the teams performed in order to award trophies.\n\nConveniently, the tournament director stored the tournament data in JSON:\n- [2016 Tournament](test/2016-tournament.json)\n- [2017 Tournament](test/2017-tournament.json)\n\n## Assignment\n\nUsing higher-order functions (map, reduce, filter, etc), write a solution that\ngenerates the results needed and passes the test suite.\n\nA skeleton for your functions has been started in [`calculate-results.js`](calculate-results.js)\n\n## Development Setup\n\nMake sure [Node.js] is installed on your system. Then, on the command line:\n\n```sh\n# installs the node_modules folder (one-time step)\nnpm install\n\n# runs the test suite\nnpm test\n```\n[Node.js]:https://nodejs.org/en/\n\n## Result Object\n\nDarren the statistician has requested the tournament results in the following\nformat:\n\n```js\n{\n  \"team5\": {\n    \"gamesLost\": 3,\n    \"gamesPlayed\": 5,\n    \"gamesTied\": 0,\n    \"gamesWon\": 2,\n    \"place\": 8,\n    \"pointDiff\": -7,\n    \"pointsLost\": 38,\n    \"pointsPlayed\": 69,\n    \"pointsWon\": 31,\n    \"teamCaptain\": \"Ryan Levins\",\n    \"teamName\": \"Eggpants Parmesan\",\n    \"victoryPoints\": 5993\n  },\n   \"team2\": { /* team2 result object goes here */ },\n   \"team3\": { /* team3 result object goes here */ }\n   /* the rest of the teams go here */\n}\n```\n\nThe tournament director has requested the results in an Array sorted by victory\npoints:\n\n```js\n[\n  {\n    \"games-lost\": 0,\n    \"games-played\": 7,\n    \"games-tied\": 0,\n    \"games-won\": 7,\n    \"place\": 1,\n    \"points-diff\": 28,\n    \"points-lost\": 35,\n    \"points-played\": 98,\n    \"points-won\": 63,\n    \"team-captain\": \"Sean McCall\",\n    \"team-id\": \"team6\",\n    \"team-name\": \"No Tsu Oh\",\n    \"victory-points\": 21028\n  },\n  { /* second place team goes here */ },\n  { /* third place team goes here */ }\n  /* the rest of the teams go here */\n]\n```\n\n## Notes\n\n- There were some teams who signed up, but did not play. Do not include these\n  teams in your results.\n- There were some games that were aborted for various reasons. Only include\n  games marked as \"final\" in your results.\n\n## Victory Points Formula\n\nVictory points are used by the [Swiss format] to determine matchups for each\nround. The formula for calculating victory points is as follows:\n\n- 3000 points for a win\n- 1000 points for a tie\n- 0 points for loss\n- then add (or subtract) point diff\n\n[Swiss format]:https://en.wikipedia.org/wiki/Swiss-system_tournament\n\n## License\n\n[ISC License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fcalculate-tournament-results","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foakmac%2Fcalculate-tournament-results","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fcalculate-tournament-results/lists"}