| 1 | package Games::Tournament::BlackJack::Player::ExamplePlayer1; | ||
| 2 | # (very simple) example player module for blackjack | ||
| 3 | # this player will hit on a 16 or less. | ||
| 4 | |||
| 5 | use Games::Tournament::BlackJack::Player; | ||
| 6 | use Games::Tournament::BlackJack::Utilities; | ||
| 7 | @ISA = qw(Games::Tournament::BlackJack::Player); | ||
| 8 | |||
| 9 | # decide_simple returns "hit", "stand", or true for hit, false for stand. | ||
| 10 | sub decide_simple { | ||
| 11 | return handValue($_[0]->{'hand'}) <= 16 ? 'hit' : 'stand'; | ||
| 12 | } # hit on 16 or less | ||
| 13 | |||
| 14 | |||
| 15 | 1; |