From 5699218bc232ad7c4ddd611757169e17be33c342 Mon Sep 17 00:00:00 2001 From: Andinus Date: Tue, 27 Apr 2021 22:02:04 +0530 Subject: Fix winning logic Previously the winning logic was faulty, it sorted players by their wallets. Now it sorts them by their points. --- lib/Caelum/CLI.rakumod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Caelum/CLI.rakumod b/lib/Caelum/CLI.rakumod index ab2b6e9..1ef4039 100644 --- a/lib/Caelum/CLI.rakumod +++ b/lib/Caelum/CLI.rakumod @@ -81,7 +81,7 @@ multi sub MAIN( } } - with @players.sort(*.wallet).reverse[0] -> $player { + with @players.sort(*.points).reverse[0] -> $player { say "{$player.name} wins $pot!"; $player.wallet += $pot; } -- cgit 1.4.1-2-gfad0