{"id":25874285,"url":"https://github.com/pioz/mtg-swiss","last_synced_at":"2026-07-03T12:02:22.007Z","repository":{"id":183433851,"uuid":"670136657","full_name":"pioz/mtg-swiss","owner":"pioz","description":"MTG Swiss Tournaments for Ruby","archived":false,"fork":false,"pushed_at":"2023-07-24T12:21:32.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-07-24T12:36:14.028Z","etag":null,"topics":["mtg","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/pioz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-24T11:25:40.000Z","updated_at":"2023-07-24T12:36:16.616Z","dependencies_parsed_at":"2023-07-24T12:50:58.224Z","dependency_job_id":null,"html_url":"https://github.com/pioz/mtg-swiss","commit_stats":null,"previous_names":["pioz/mtg-swiss"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pioz%2Fmtg-swiss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pioz%2Fmtg-swiss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pioz%2Fmtg-swiss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pioz%2Fmtg-swiss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pioz","download_url":"https://codeload.github.com/pioz/mtg-swiss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241482735,"owners_count":19969969,"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":["mtg","ruby"],"created_at":"2025-03-02T09:19:43.175Z","updated_at":"2025-10-30T04:41:50.560Z","avatar_url":"https://github.com/pioz.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build](https://github.com/pioz/mtg-swiss/workflows/Ruby/badge.svg)\n[![codecov](https://codecov.io/gh/pioz/mtg-swiss/branch/master/graph/badge.svg?token=bsSUOW6wWa)](https://codecov.io/gh/pioz/mtg-swiss)\n[![rdoc](https://img.shields.io/badge/yard-doc-blue)](https://pioz.github.io/mtg-swiss)\n\n# MTG Swiss\n\nA lightweight Ruby library implementing Magic the Gathering Swiss tournament\nrules. Easily integrate points systems, ranking, and tiebreaker rules for\nfair and competitive event management. Elevate your tournaments with minimal\neffort.\n\nThe tournament unfolds as follows:\n\n1. For the first round, players are randomly paired.\n2. After each round, the standings are calculated.\n3. Players are paired based on their partial ranking in a strict manner,\n   rank 1 will compete against rank 2, rank 3 against rank 4, and so on. It is\n   ensured that a player does not face the same opponent multiple times.\n4. This process continues until the total number of rounds is reached, which is `log2(number_of_players)`.\n\nThe following tiebreakers are used to determine the standings:\n\n1. Match points\n2. Opponents' match-win percentage\n3. Game-win percentage\n4. Opponents' game-win percentage\n\n[Official Wizards of the Coast Tournament Rules](https://media.wizards.com/2023/wpn/marketing_materials/wpn/mtg_mtr_2023may29_en.pdf)\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add 'mtg-swiss'\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install 'mtg-swiss'\n\n## Usage\n\n```ruby\nt = Swiss::Tournament.new(%w[Enrico Nicola Luca Alberto])\nt.set_table_result(0, 2, 0)\nt.set_table_result(1, 2, 1)\nt.next_round\nt.standings\nt.finished?\n```\n\nAll docs available here: https://pioz.github.io/mtg-swiss\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/pioz/mtg-swiss.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpioz%2Fmtg-swiss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpioz%2Fmtg-swiss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpioz%2Fmtg-swiss/lists"}