RT for rt.cpan.org
Skip Menu
|
Bug #48149 for Games-Tournament-Swiss: b is not q-w and w is not q-b
Active bugs
Resolved bugs
Rejected bugs
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)
History
Show all quoted text
Thu Jul 23 23:42:01 2009
DRBEAN [...] cpan.org - Ticket created
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
Fri Jul 24 00:21:24 2009
DRBEAN [...] cpan.org - Correspondence added
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;
Fri Jul 24 00:21:25 2009
DRBEAN [...] cpan.org - Status changed from 'new' to 'resolved'