Skip to content

Commit

Permalink
0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 10, 2024
1 parent 4aeefbb commit e422628
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Revision history for Algorithm::Elo

{{$NEXT}}
- Initial version

0.1.1 2024-08-10T16:56:33+02:00
- Initial version as a Raku Community Module
2 changes: 1 addition & 1 deletion META6.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"auth": "zef:community-modules",
"auth": "zef:raku-community-modules",
"authors": [
"Rob Hoelz",
"Raku Community"
Expand Down
4 changes: 1 addition & 3 deletions lib/Algorithm/Elo.rakumod
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
unit module Algorithm::Elo;

my constant $k = 32;

my sub do-it(Int:D $delta) {
1 / (1 + (10 ** ($delta / 400)));
}

our sub calculate-elo(
my sub calculate-elo(
Int:D $left,
Int:D $right,
Bool :left($left-wins),
Expand Down
3 changes: 1 addition & 2 deletions t/01-basic.rakutest
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use Algorithm::Elo;

plan 12;

( my $player-a, my $player-b ) =
Algorithm::Elo::calculate-elo(1_600, 1_600, :left); # check "our"
( my $player-a, my $player-b ) = calculate-elo(1_600, 1_600, :left);

is $player-a, 1_616;
is $player-b, 1_584;
Expand Down

0 comments on commit e422628

Please sign in to comment.