Permalink
Browse files

re-visualize after every round

  • Loading branch information...
1 parent ea7ab0a commit 9d03dbd6227a953cbfe2ec3485d761bbe9c995ac @ericherman committed Dec 21, 2011
Showing with 14 additions and 2 deletions.
  1. +14 −2 texas-holdem.pl
View
16 texas-holdem.pl
@@ -72,6 +72,7 @@ sub visualize_game {
my $num_players = 5;
+my $house_hand = Hand->new();
my @hands;
for ( my $i = 0 ; $i < $num_players ; $i++ ) {
push @hands, Hand->new();
@@ -83,8 +84,11 @@ sub visualize_game {
}
}
-my $house_hand = Hand->new();
-my $burn = $deck->deal_card();
+visualize_game( $house_hand, @hands );
+my $userinput = <STDIN>;
+chomp($userinput);
+
+my $burn = $deck->deal_card();
for my $i ( 1 .. 3 ) { #flop
my $card = $deck->deal_card();
@@ -93,13 +97,21 @@ sub visualize_game {
}
}
+visualize_game( $house_hand, @hands );
+$userinput = <STDIN>;
+chomp($userinput);
+
$burn = $deck->deal_card();
my $turn = $deck->deal_card();
foreach my $hand ( $house_hand, @hands ) {
$hand->add_card($turn);
}
+visualize_game( $house_hand, @hands );
+$userinput = <STDIN>;
+chomp($userinput);
+
$burn = $deck->deal_card();
my $river = $deck->deal_card();

0 comments on commit 9d03dbd

Please sign in to comment.