Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Swiss, double elimination and round robin tournaments

Đang mở
#25 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
backend, frontend, testing

Hướng nghiên cứu

Start with backend/routes/tournaments.js to understand the existing single-elimination flow, then inspect the tournament bracket or standings view and the test setup. The issue calls for pure format modules under backend/tournaments/formats/*.js, exhaustive property tests, and mobile-friendly views. Done means all three formats meet the stated rules, tie-breaks are documented on the tournament page, and npm test and node scripts/check-boundary.js pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement help wanted

Tournaments only support single elimination (format = 'single_elimination' in backend/routes/tournaments.js). Half the field is out after one match, which is a poor experience for a community event where most players came to play.

Formats to add

  • Swiss: everyone plays a fixed number of rounds (default ceil(log2(n))), paired against players with the same score. Nobody is eliminated. Best for large open events.
  • Double elimination: a winners bracket and a losers bracket, with a grand final where the winners-bracket player needs one win and the losers-bracket player needs two (bracket reset).
  • Round robin: everyone plays everyone. Best for small groups of up to 8.

Rules that must hold

  • Swiss pairing never repeats an opponent when another valid pairing exists, and gives a bye to the lowest-ranked player without one when the count is odd. Use a proper pairing algorithm rather than greedy pairing, which fails late in the event.
  • Tie-breaks for Swiss and round robin: Buchholz score, then head to head, then total solve time. Document them on the tournament page.
  • No-shows lose the match after the existing check-in window. Repeated no-shows are dropped from later rounds.
  • Format logic lives in pure modules (backend/tournaments/formats/*.js) with no database access, so it can be tested exhaustively.

Definition of done

  • Property tests: for random field sizes from 2 to 128 and random results, every format finishes, every match has valid players, Swiss never repeats an avoidable pairing, and double elimination crowns exactly one winner.
  • The bracket or standings view renders each format clearly, including on a phone.
  • npm test and node scripts/check-boundary.js pass.
Ngôn ngữ chính
JavaScript
Star
0
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sennaicodes/codearena

Tất cả issue của sennaicodes/codearena

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.