Skip Menu |

This queue is for tickets about the Games-Tournament-Swiss CPAN distribution.

Report information
The Basics
Id: 48149
Status: resolved
Priority: 0/
Queue: Games-Tournament-Swiss

People
Owner: Nobody in particular
Requestors: DRBEAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.16
Fixed in: (no value)



Subject: b is not q-w and w is not q-b
b = q-w only if everyone has a preference. With latecomers who don't have a preference, b and w have to be calculated independently.67g
http://chesschat.org/showpost.php?p=248965&postcount=42 From Games::Tournament::Swiss::Bracket::x - my $w = - grep { $_->preference->role and $_->preference->role eq (ROLES)[0] } - @$players; - my $b = @$players - $w; + my $numbers = sub { + my $n = shift; + return scalar grep { + $_->preference->role and $_->preference->role eq (ROLES)[$n] } + @$players; + }; + my $w = $numbers->(0); + my $b = $numbers->(1); my $q = $self->q; my $x = $w >= $b ? $w - $q : $b - $q; - $self->{x} = $x; + $self->{x} = $x < 0? 0: $x;