• No results found

6.1 - General conclusions

Four computer players, i.e. Random – 1, Random -2, Anki – V1 and Anki – V2, along with initial strict strategy players such as Always-Checks1, Always-Checks2, Always-Bets and Always- Raises were created by the author of this thesis.

The project succeeded in its goal to make Knowledge and Strategy based Texas-Hold'em Poker Players in Prolog. The players created, Anki – V1 and Anki – V2, were of good quality and provided many positive results. They were created using different approaches, which were well documented, and have been presented in this thesis. The documentation also verifies the stability and soundness of the program, which allows the results to be considered reliable. Through these results, the quality of Anki – V1 and Anki – V2 can be justified to be good, as they both appear to be sub-intermediate level, with the possibility of Anki – V2 excelling given the correct settings. Both Anki – V1 and Anki – V2 were evaluated against Random – 1, a completely random player; Random – 2, a non-folding random player; and three categories of Human Players, Beginner, Intermediate and Advanced.

The project followed a life-cycle shown in Figure 39. The author's previous knowledge and extensive reading provided a basis for Human Heuristics. These heuristics were formulated into Computer/Machine Heuristics. Experimentation led to many lessons being learned and being re- iterated to improve the Human Heuristics, which lead to further formulation of Computer Heuristics.

6.2 - Conclusions of Anki – V1 and Anki – V2

Anki – V1 used a Knowledge Base and Rule-Based Hand Evaluation technique to convert each hand into a form of pattern. These patterns were grouped together using a technique known as Bucketing, which was found to be very effective, and similar to the manner in which the human brain treats its poker hands. These buckets were assigned scores based on their potential to form winning hands, and further, these scores were converted into strategies which changed over the game but remained strict over a betting round.

Anki – V1 played very well against Beginner Human Players and won all its tournaments. It fought hard against the Intermediate Human Players, but lost eventually, and finally, lost

comprehensively against Advanced Player. The main reason behind its defeat was found to be the predictable tight strategy that it followed, more on which is discussed in Section 6.3.

Anki – V2 offered a Simulation and Enumeration based approach to the two-player Poker Playing scenario. It calculated its Winning Potential by playing simulated games with its current hand and other available knowledge. This Winning Potential was converted into Probability Triples through formulas that control the player's Aggressive and Conservative behaviours. These probability triples remained static over a betting round, but were used to create a controlled randomised betting action every time the player is faced with a decision. The decisions were slightly altered through the Winning Potential Threshold that controlled the player's Tightness and Looseness behaviours. Finally, the player recorded the opponent's actions in the game, and used enumeration to make small changes to the Winning Potential to reflect it more accurately.

Anki – V2 was found to perform even better in most respect than Anki – V1 through its ability to tweak the Aggressiveness and Tightness of its strategies. This was apparent when it played against Random – 2 and Anki – V1 in tournament play as discussed in Section 5.5. Anki – V2 beats all the Beginner Human Players, slightly better than Anki – V1. It also loses against Intermediate players but after a longer struggle than Anki – V1. This is mostly due to its randomised betting action strategies that make it harder to figure out. Finally, Anki – V2 loses

Players if enough experiments are carried out with humans to tune its Aggressive and Tightness Behaviours against those of the Intermediate Human Players.

Comparison of results obtained from PsOpti's play against the master level human player, 'the count', and that of Anki – V2 against Intermediate Level Human Players revealed that Anki – V2 was at least just below Intermediate Level in its play. This coupled with the fact that Anki – V2 can further be tweaked in its strategies to play Intermediate Level Players even better, means that it can possibly claim to be Intermediate Level with the right adjustments.

6.3 - Conclusions of Poker Game and Betting Strategies

The creation and evaluation of Poker Players Anki – V1 and Anki – V2 have revealed a lot of interesting results and conclusions relating to human strategies. As discussed earlier, one category of strategies is concerning the relative number of hands played, which is described by Tight, Moderate or Loose. Anki – V1 was found to be very tight, as it only played the hands it had a very good chance of winning in, and Anki – V2 was found to range from tight to moderate depending on its randomised betting strategy.

The second category of discussing player strategies is concerning the amount bet per game. Both Anki – V1 and Anki – V2 were very aggressive. This was a good choice as both players showed good winnings in the games that they were confident of winning, and thus the aggressive attitude managed to take more money than usual away from the Human Players they played against.

The extremely tight strategy of Anki – V1 was defeated by loose strategies of Human Players. Beginners lost their games due to bad plays, and never sticking to a strategy. They also folded early in the game without trying to figure out the hand that Anki – V1 may have. Thus, a tight

strategy against a very tight intelligent player does not work. Both advanced and intermediate

human players eventually defeated Anki - V1 by adopting loose strategies and trusting the player. Thus, a predictably tight player can be defeated by a reactive loose player. The human players had to be reactive loose players, i.e. react to the strategy of Anki – V1 and fold when Anki – V1 raises multiple times. The need for the reactive aspect can be proven by looking at the play of Anki – V1 against Random – 2. Random – 2 was a very loose player and it lost against Anki – V1 to the extent of 93% of the tournaments. It can thus be concluded that a tight aggressive player

will beat a very loose player. The aggressiveness can be shown through the reasoning that a tight

player needs to make up for the money lost in folding numerous games through winning large amounts in the games that it plays to the end.

Anki – V2 offered a much better test-bed for strategy manipulation as its aggressive and tightness strategies could be tweaked to give the desired combinatorial strategy. Anki – V2's victory against Beginners was for the same reason as that of Anki – V1, but its longer struggle against

Intermediate Human Players arose from its unpredictability and randomised betting strategy which forced the human players to observe the player for longer to figure out a strategy to defeat it. Thus, a controlled randomised strategy is a much better option against human players, as it adds confusion to a human player's mind. Anki – V2's quick defeat against Advanced players was also one of the project's biggest lessons. Even though it is known that Anki – V2 could be tweaked to perform better against that category of human players, the conclusion received from the experiment was that betting strategies need to be remembered over betting rounds. This is true as most of the Advanced Players commented on Anki – V2's excellent unpredictability, but poor choice to fold a bluffed hand after committing lots of money to the pot.

Anki – V2 also lost horribly against Random – 2 player, this was because an unsure moderate

(tightness index) player will loose to a completely loose player. However, when the moderate

player is converted into an intelligent loose player, it can perform wonders, as the intelligent

loose player was found to beat the completely loose player in over 98% of the tournaments

played. By intelligently loose, it refers to the fact that Anki – V2 chose to fold the worst of its hands.

Finally, the last conclusion was obtained through the play of Anki – V1 against Anki – V2. They were both created equal, and they performed as such. But as usual, Anki – V2's adaptive

capabilities allowed it to gain an upper hand through modifications. In the case of equal

tightness, the more aggressive player is found to win. This was proven through the

6.4 - Future Work

6.4.1 – The Anki Poker Teaching Tool

The quality of Anki – V1 and Anki – V2 allow these players to be excellent tools for teaching beginner and intermediate players simple strategies of tightness and aggressiveness. These players have already been fully coded, with the Prolog code provided in Appendix A, and thus only need small additions to form teaching support. Both players have also proven their stability through both documentation and extensive play against computer and human players.

Anki – V1 plays against beginner players really well, and offers a great future as a teaching tool of poker to new human poker players. This is because it plays just above their level, and is based completely on rules and strict strategy. Each action of Anki – V1 is justified through the hand strength or the hand potential, and it can use this information to suggest possible moves and provide support to beginner level human players. Human players at this level were found to have most trouble understanding the concepts of poker, and getting to grasp with the winning patterns and simple loose and tight strategies. All of these aspects can be expressed through an Anki – V1 based help engine.

Anki – V2 offers a slightly higher level teaching tool, as it encompasses not just tightness and looseness but also aggressive and conservative strategies. On top of that, it is also fully customisable, which allows a person to set the playing strength of Anki – V2. Moreover, the complete control over Anki – V2's strategy, allows people learning poker to learn to play against Aggressive, Conservative, Tight, Loose and Moderate players all using the same program. This way, users can experience play against particular strategies, and learn to play better. The strategy maker itself can be randomised, to give the user an Intermediate – level playing platform. Once again, like Anki – V1, coding of the actual methods has already been done. Anki – V2's learning tool can also provide help to its users, by giving them a good estimate of the winning probability of their current hand, thereby allowing them to learn the value of any kind of hand.

6.4.2 - Testing and Extensions to project

The previous section discussed one of the possible applications of Anki – V1 and Anki – V2. There are also certain additions that can to be made to the project, to both improve and realise its full potential. Most of these additions involve human testing with the various settings of Anki – V2. There is very few code addition to be done, but the inputs of experts to help provide better enumeration is explored further in Section 6.4.3.

Anki – V1 has a static hand evaluation technique, and thus all of its groups and scoring system was put to a complete test when it was played against both pre-coded players and Human players. The extension that can be considered for this player involves the increase in scoring categories for buckets and additional strategies. The current buckets are based on the patterns that were

observed in the Anki – V1's hand. The scoring system only involves numbers 0 to 4, in which 0 signifies the strategy of 'check else fold', 1 – 2 allocates betting, 3 allocates raising and 4 signifies an excellent finished pattern which does not need to be re-evaluated. The scoring system can be extended to provide support for additional strategies, some of which are present in Poki [10], like 'check else bet', 'bet if opponent checks, else check', etc.

Anki – V2, being the second player that was created, did not get the full extensive testing it deserved to show its abilities against human players. It showed how by changing its internal strategies, it could perform much better against static strategy players. Using the same reasoning, and an automated strategy modifier, it can force it's opponents to frequently change their strategy against this Anki – V2 as well, thereby increasing its performance. Also, this would allow a much more extensive set of conclusions similar to the kind that were documented in Section 6.3.

6.4.3 - Resource based extensions to project

One of the major aspects missing from this project was that of expert systems. All previous players such as Loki, Poki and PsOpti had the expert input available from a master level player, i.e. Darse Billings. The author of this project started from being an Intermediate Human Player and can now be considered Advanced at best. Darse Billings justifies a lot of his heuristics and

input from a high-level Poker Player can offer a lot to the expert systems of Anki – V1 and the strategy formation of Anki – V2. The final help of an expert lies in the enumeration strategy of Anki – V2, which can only be confirmed by master level players due to the strategy's complexity and presence in mostly master-level tournaments.

Anki – V1 and Anki – V2 both also estimate the Winning Potential through bucketing and simulation respectively. Higher computation power and an time efficient platform can help overcome the exponential blow up of the exact statistical method of Winning Potential calculation. This can help future computer players to have more exact strategies and assign near-optimal values to it's hands at any point in the game.

Another possible extension to the program can be its migration to a platform-independent language such as Java, or to incorporate a Java interface to the already existing Prolog code. This would allow the users of the program to test it at their convenience, and provides the possibility of publishing it online.

Anki – V1 and Anki – V2 are very good players in their own respect, but they form even a better foundation for the future to understand human behaviour and replicate it in the Poker Playing community. As the results from this project show, the day when Imperfect Information Games compete well with Master level players in full size tournaments is definitely close at hand.

Bibliography

1. D. Koller, A. Pfeffer; Generating and Solving Imperfect Information Games. IJCAI 1995: 1185-1193.

2. D. Billings, N. Burch, A. Davidson, R. Holte, J. Schaeffer, T. Schauenberg, D. Szafron; Approximating Game-Theoretic Optimal Strategies for Full-scale Poker. IJCAI 2003: 661-668.

3. D. Papp; Dealing with imperfect information in poker. Master's thesis, Department of Computing Science, University of Alberta, 1998.

4. S. J. J. Smith and D. S. Nau; Strategic planning for imperfect-information games. In Working Notes of the AAAI Fall Symposium on Games: Planning and Learning, 1993. 5. D. Koller, A. Pfeffer; Representations and Solutions for Game-Theoretic Problems. Artif.

Intell. 94(1-2): 167-215 (1997).

6. S. A. Gordon; A comparison between probabilistic search and weighted heuristics in a game with incomplete information, in: AAAI Fall 1993.

7. J. R. S. Blair, D. Mutchler and C. Liu; Games with imperfect information. In Proceedings of the AAAI Fall Symposium on Games: Planning and Learning, 59— 67 (1993).

8. D. Koller, N. Megiddo, B. von Stengel; Fast algorithms for finding randomized strategies in game trees. STOC 1994: 750-759 (1994).

9. M. van Lent and D. Mutchler; A pruning algorithm for imperfect information games. In Proceedings of the AAAI Fall Symposium on Games: Planning and Learning (1993). 10. D. Billings, A. Davidson, J. Schaeffer, D. Szafron: The challenge of poker. Artif. Intell.

134(1-2): 201-240 (2002).

11. J. Schaeffer, D. Billings, L. Pea, D. Szafron; Learning to Play Strong Poker. In

proceedings of the Sixteenth International Conference on Machine Learning (ICML-99), J. Stefan Institute, Slovenia (Invited Paper), 1999.

12. J. Cassidy; The Last Round of Betting in Poker, The American Mathematical Monthly, Vol. 105, No. 9. (Nov., 1998), pp. 825-831.

13. D. Billings, L. P. Castillo, J. Schaeffer, D. Szafron; Using Probabilistic Knowledge and Simulation to Play Poker. AAAI/IAAI 1999: 697-703.

14. J. Shi, M. L. Littman; Abstraction Methods for Game Theoretic Poker. Computers and Games 2000: 333-345.

15. A. Junghanns, J. Schaeffer; Search Versus Knowledge in Game-Playing Programs Revisited. IJCAI (1) 1997: 692-697.

Edition, Princeton University Press, NJ, 1947.

19. H.W. Kuhn; A simplified two-person poker, Contributions to the Theory of Games 1 (1950) 97–103.

20. N. Findler; Studies in machine cognition using the game of poker. Communications of the ACM 20(4):230-245 (1977).

21. C. Cheng; Recognizing poker hands with genetic programming and restricted iteration. Genetic Algorithms and Genetic programming at Stanford, J. Koza (editor), Stanford, California (1997).

22. D. Sklansky and M. Malmuth; Texas Hold’em for the Advanced Player, Two Plus Two Publishing, 2nd edition, 1994.

23. K. Takusagawa; Nash equilibrium of Texas Hold’em poker, Undergraduate thesis, Computer Science, Stanford University, 2000.

Appendix A – Program Code

% This program is the one that was used to test Human Play against Anki – V2. It still contains all the %different players such as Anki – V1, Random – 1, etc. within it.

:- use_module(library(system)).

% 1 - 13 for Ace, 2, 3, ... Jack, Queen and King % 1 - 4 for Clubs, Diamonds, Hearts and Spades. % Strategy 1 - Always bets.

% Strategy 2 - Always raises when possible, otherwise bets. % Strategy 3 - Random choice including folding.

% Strategy 4 - Random choice without folding.

% Strategy 5 - Uses initial eval to decide fold(check) or bet. % Strategy 6 - Uses initial eval to decide fold(check) or raise. % Strategy 7 - Uses initial eval to decide fold(check) or bet or raise. % Strategy 8 - Uses initial eval to decide Strategy 3 or 4.

%

:- dynamic seed/1. seed(124353425). :- nl, nl,

write('************ Welcome to Texas Hold Them ***************'), nl, write('* Each card is represented in a tuple *'), nl,

write('* (Card-number,Card-suit) as denoted below: *'), nl, write('* *'), nl,

write('* 1 - 13 for Ace, 2, 3, ... Jack, Queen and King; *'), nl, write('* 1 - 4 for Clubs, Diamonds, Hearts and Spades. *'), nl,

write('*******************************************************'), nl, write('Please give seed : '),

read(X), retract(seed(_)), assert(seed(X)),

nl, write('*******************************************************'), nl, write('Please write play. to start game!'), nl,

write('*******************************************************'), nl. % rand(R) generates random real number R in the range [0,1)

rand(R) :- retract(seed(S)),

N is (S * 314159262 + 453816693) mod 2147483647, assert(seed(N)),

R is integer(M * RR). random_float(R,M) :- rand(RR), R is (M * RR). play:-

open('ac_poker_result.pl', append, Stream), play_poker(X, (0,0,0,0,0,0,0), Stream), (X = 0 -> true ; play(X, Stream)),

nl, write('*******************************************************'), nl, write('Please write play. again to play more games.'), nl,

write('*******************************************************'), nl, close(Stream).

play(X, Stream):-

play_poker(Y, X, Stream), (Y = 0 -> true ; play(Y, Stream)). play_poker(X, N1, Stream):- initialise_game(A), set_players(A, B, C, 1000.0, 1000.0), play_game(A, B, C, X, 0, N1, Stream), !. play_poker(X, Y, Z, 'n', N, N1, Stream):- end_game_check(Y, Z, X, N, N1, Stream), !. play_poker(X, Y, Z, 'y', N, N1, Stream):-

initialise_game(A), set_players(A, B, C, Y, Z),

play_game(A, B, C, X, N, N1, Stream), !. play_poker(X, Y, Z, _, N, N1, Stream):-

nl, write('Kindly choose from the given options of y or n!'), nl, write('Do you wish to play another game? '),

read(A), play_poker(X, Y, Z, A, N, N1, Stream). initialise_game(X) :- game_hand(X). game_hand(X):- run_rand(X, [], 4), !. set_players(A, B, C, D, E) :- A = [M,N|P], B = (1, [M,N], D), C = (2, P, E). end_game_check(B1, C1, X, N, (_, _, _, _, N6, N7, N9), Stream) :- nl, write('*******************************************************'), nl, write('The tournament has ended. Player 1 has '), write(B1),

write(' money, and Player 2 has '), write(C1), write('.'), nl,

write(Stream, ' money, and Player 2 has '), write(Stream, C1), write(Stream, '.'), nl(Stream), X = 0,

(B1> C1 -> write('Player 1 wins the tournament!') ; write('Player 2 wins the tournament!')), write('There were '), write(N), write(' games played.'),

nl, write('Player 1 won '), write(N6), nl, write('Player 2 won '), write(N7), nl, write('Drawn games were '), write(N9),

write(Stream, 'There were '), write(Stream, N), write(Stream, ' games played.'), nl(Stream), write(Stream, 'Player 1 won '), write(Stream, N6),

nl(Stream), write(Stream, 'Player 2 won '), write(Stream, N7), nl(Stream), write(Stream, 'Drawn games were '), write(Stream, N9),!. play_game(_, (_,_,0.0), (_,_,C1), X, N, (N1, N2, N3, T, N6, N7, N9), Stream) :-

T1 is T + N, N4 is N3 + 1, N5 is N1 + 1,

nl, write('*******************************************************'), nl, write('The tournament has ended. Player 1 has 0 money, and Player 2 has '),

write(C1), write('.'),

nl, write('Player 2 wins the tournament! '),

write('There were '), write(N), write(' games played.'), !, (N5 > 0 -> X = 0, write(N5), write(' tounaments played.'), nl, write('Total games played: '), write(T1),

nl, write('Player 1 won '), write(N2), write(' and '), write(N6), nl, write('Player 2 won '), write(N4), write(' and '), write(N7), nl, write('Drawn games were '), write(N9),

nl(Stream), write(Stream, 'Total games played: '), write(Stream, T1), nl(Stream), write(Stream, 'Player 1 won '), write(Stream, N6), nl(Stream), write(Stream, 'Player 2 won '), write(Stream, N7), nl(Stream), write(Stream, 'Drawn games were '), write(Stream, N9); X = (N5, N2, N4, T1, N6, N7, N9)). play_game(_, (_,_,5.0), (_,_,C1), X, N, (N1, N2, N3, T, N6, N7, N9), Stream) :- T1 is T + N, N4 is N3 + 1, N5 is N1 + 1, nl, write('*******************************************************'), nl, write('The tournament has ended. Player 1 has 5 money, and Player 2 has '),

write(C1), write('.'),

nl, write('Player 2 wins the tournament! '),

write('There were '), write(N), write(' games played.'), !, (N5 > 0 -> X = 0, write(N5), write(' tounaments played.'), nl, write('Total games played: '), write(T1),

nl, write('Player 1 won '), write(N2), write(' and '), write(N6), nl, write('Player 2 won '), write(N4), write(' and '), write(N7), nl, write('Drawn games were '), write(N9),

nl(Stream), write(Stream, 'Total games played: '), write(Stream, T1), nl(Stream), write(Stream, 'Player 1 won '), write(Stream, N6), nl(Stream), write(Stream, 'Player 2 won '), write(Stream, N7),

T1 is T + N, N4 is N2 + 1, N5 is N1 + 1,

nl, write('*******************************************************'), nl, write('The tournament has ended. Player 2 has 0 money, and Player 1 has '),

write(B1), write('.'),

nl, write('Player 1 wins the tournament! '),

write('There were '), write(N), write(' games played.'), !, (N5 > 0 -> X = 0, write(N5), write(' tounaments played.'), nl, write('Total games played: '), write(T1),

nl, write('Player 1 won '), write(N4), write(' and '), write(N6), nl, write('Player 2 won '), write(N3), write(' and '), write(N7), nl, write('Drawn games were '), write(N9),

nl(Stream), write(Stream, 'Total games played: '), write(Stream, T1), nl(Stream), write(Stream, 'Player 1 won '), write(Stream, N6), nl(Stream), write(Stream, 'Player 2 won '), write(Stream, N7), nl(Stream), write(Stream, 'Drawn games were '), write(Stream, N9); X = (N5, N4, N3, T1, N6, N7, N9)). play_game(_, (_,_,B1), (_,_,5.0), X, N, (N1, N2, N3, T, N6, N7, N9), Stream) :- T1 is T + N, N4 is N2 + 1, N5 is N1 + 1, nl, write('*******************************************************'), nl, write('The tournament has ended. Player 2 has 5 money, and Player 1 has '),

write(B1), write('.'),

nl, write('Player 1 wins the tournament! '),

write('There were '), write(N), write(' games played.'), !, (N5 > 0 -> X = 0, write(N5), write(' tounaments played.'), nl, write('Total games played.'), write(T1),

nl, write('Player 1 won '), write(N4), write(' and '), write(N6), nl, write('Player 2 won '), write(N3), write(' and '), write(N7), nl, write('Drawn games were '), write(N9),

nl(Stream), write(Stream, 'Total games played.'), write(Stream, T1), nl(Stream), write(Stream, 'Player 1 won '), write(Stream, N6), nl(Stream), write(Stream, 'Player 2 won '), write(Stream, N7), nl(Stream), write(Stream, 'Drawn games were '), write(Stream, N9); X = (N5, N4, N3, T1, N6, N7, N9)). play_game(A, (1,B,B0), (2,C,C0), X, N, N2, Stream) :- N1 is N + 1, B1 is B0 - 10, C1 is C0 - 10, nl, write('*******************************************************'), nl, write('Your hand (personal 2 cards) is : '), write(B), nl,

write('*******************************************************'), nl, nl(Stream), write(Stream, 'Player 1 has cards : '), write(Stream, B),

nl(Stream), write(Stream, 'Player 2 has cards : '), write(Stream, C), % First round evaluation and betting.

write(Stream, Good1), %eval_start(C, E), %better(E, _), !,

betting_round(1, B, C, [], B1, C1, 20.0, B2, C2, R1, 'c', P, 0, 0, Good1, Stream, 0, _), % Second Round evaluation and betting.

get_flop(A, Y, T1, P, Stream), eval_flop_good(C, Y, Good2, T1), write(Stream, Good2), append(C, Y, Cf), ace_it(Cf, Cf1), q_sort(Cf1, [], Cf2),

%setof(E2, eval_flop(C, Cf2, 2, E2), E3), %get_best_str(E3, E4),

%better(E4, E5), !,

betting_round(1, B, C, Y, B2, C2, R1, B3, C3, R2, P, P1, 0, 0, Good2, Stream, 0, Chan), write(Stream, Chan),

% Third round evaluation and betting. get_turn(T1, D, T2, P1, Stream),

eval_turn_good(C, Y, [D], Good3, T2, Chan), write(Stream, Good3),

append([D], Y, F), insert_card(D, Cf2, Ct), !,

%setof(E6, eval_turn(C, Ct, 2, E6), E7), %get_best_str(E7, E8),

%better(E8, E9), !,

betting_round(1, B, C, F, B3, C3, R2, B4, C4, R3, P1, P2, 0, 0, Good3, Stream, Chan, Chan1), write(Stream, Chan1),

% Final round of betting get_river(T2, G, P2, Stream),

eval_river_good(C, Y, [D], [G], Good4, Chan1), write(Stream, Good4),

append([G], F, H), insert_card(G, Ct, Cr), !,

%setof(E10, eval_river(C, Cr, 2, E10), E11), %get_best_str(E11, E12),

%better(E12, E13), !,

betting_round(1, B, C, H, B4, C4, R3, B5, C5, R4, P2, P3, 0, 0, Good4, Stream, 0, _), % Final evaluation - Complete!

final_eval(B, C, H, Cr, B5, C5, R4, B6, C6, P3, P4, Stream), game_add(P4, N2, (N3,N4,N5,N6,N7,N8,N9)),

nl, write('*******************************************************'), nl, (P4 = 3 -> write('It is a draw!'), write(Stream, 'It is a draw!');

write('*******************************************************'), nl, nl(Stream), write(Stream, ' ; ; ; '), write(Stream, N1), write(Stream, ' ; '), write(Stream, N7), write(Stream, ' ; '), write(Stream, N8), write(Stream, ' ; '), write(Stream, N9),

write(Stream, ' ; '), write(Stream, B6), write(Stream, ' ; '), write(Stream, C6), nl, nl, nl, write('Do you wish to play another hand? Type y for yes and n for no : '),

read(X1), play_poker(X, B6, C6, X1, N1, (N3,N4,N5,N6,N7,N8,N9), Stream). insert_card([], Ct, Ct). insert_card((1,S), X, [(14,S)|T]):- append(X, [(1,S)], T). insert_card((A,S), [], [(A,S)]).

Related documents