journeyman-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Tourney.Format.RoundRobin

Synopsis

Documentation

roundRobin :: Steps () () Source #

Version 2: I begin implementing this using functions from indices to values, rather than lists, since I suspected we'll be able to express the rotate function much more simply, and without any infinite lists, while perhaps discovering a "simpler" form for the round robin circle method algorithm:

0 -> [0 .. n]
1 -> 0 : n : [1 .. n - 1]
2 -> 0 : n : n - 1 : [2 .. n - 2]

==>
     i -> 0 : [n .. n - i + 1] ++ [i .. n - i]

groupRoundRobin :: Int -> Steps () () Source #

Divide a tournament into n groups, and perform a round-robin within each group. Simply applies the divideInto combinator. groupRoundRobin numGroups = divideInto numGroups roundRobin

roundRobinEirikAlbrigtsen :: Int -> [[Match]] Source #

For another comparison, I take an existing implementation available here https://hackage.haskell.org/package/Tournament-0.0.1/docs/src/Game-Tournament.html#robin as an example and adapt it to the "journeyman" style. It is licensed MIT, and its license is reproduced below:

(The MIT License)

Copyright (c) 2012 Eirik Albrigtsen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.