Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
gdonald committed Jun 17, 2023
1 parent dad6455 commit eb3d123
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/Console/Blackjack.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class Game is export {

$h.bet /= 2;
$h.played = True;
$h.payed = True;
$h.paid = True;
$h.status = Hand::Status::Lost;
$!money -= $h.bet;

Expand Down Expand Up @@ -259,8 +259,8 @@ class Game is export {
my Bool $dhb = $!dealer-hand.is-busted;

for @!player-hands -> $h {
next if $h.payed;
$h.payed = True;
next if $h.paid;
$h.paid = True;

my Int $phv = $h.get-value(Hand::CountMethod::Soft);

Expand Down
8 changes: 4 additions & 4 deletions lib/Console/Blackjack/PlayerHand.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class PlayerHand is Hand is export {
has $!game;
has Rat $.bet is rw;
has Hand::Status $.status is rw;
has Bool $.payed is rw;
has Bool $.paid is rw;

submethod BUILD(:$!game, :$!bet) {
++PlayerHand.total-player-hands;
$!status = Hand::Status::Unknown;
$!payed = False;
$!paid = False;
}

method get-action {
Expand Down Expand Up @@ -108,9 +108,9 @@ class PlayerHand is Hand is export {
if $.played || $.stood || self.is-blackjack || self.is-busted || 21 == self.get-value(Hand::CountMethod::Soft) || 21 == self.get-value(Hand::CountMethod::Hard) {
$.played = True;

if !$!payed {
if !$!paid {
if self.is-busted {
$!payed = True;
$!paid = True;
$!status = Hand::Status::Lost;
$!game.money -= $!bet;
}
Expand Down

0 comments on commit eb3d123

Please sign in to comment.