commit 71b0c0e84554c0a236fbb9fe3547774452bb2f5a
parent fd1575bfe691d992219363068cd341e90a85eef6
Author: Samir Parikh <noreply@samirparikh.com>
Date: Mon, 6 Dec 2021 16:10:27 +0000
update day04-1.pl to prelace if statement with unless statement
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/day04-1.pl b/day04-1.pl
@@ -147,7 +147,7 @@ until ($winner_found) {
$number = shift( @numbers );
play_turn($number, \@boards, \%state);
$winner_found = check_for_winner(\@boards, \%state);
- if ((scalar(@numbers)) == 0) {
+ unless (@numbers) { # if we run out of numbers
say "Out of numbers. No winner found.";
last;
}