Add docstrings and doctests to pbot.py + Python cleanups.
[poker.git] / PBOT.py
diff --git a/PBOT.py b/PBOT.py
deleted file mode 100644 (file)
index fdcb384..0000000
--- a/PBOT.py
+++ /dev/null
@@ -1,63 +0,0 @@
-import popen2
-from DECK import *
-from GAMEPLAY import *
-global GLOBAL_TXT
-#import psyco; psyco.full()
-
-start_stack = 1000
-blinds      = [1,2,4,8,16,25,37,50]
-hand_clock  = 20
-
-# Command line arguments
-import sys
-
-try   : A = player(sys.argv[1],sys.argv[1]) 
-except: A = player('Meg')
-try   : B = player(sys.argv[2], sys.argv[2])
-except: B = player('Jack')
-try   : tournament_N = int(sys.argv[3])
-except: tournament_N = 1
-
-P = [A,B]
-for n in xrange(tournament_N):
-    A.cash = start_stack
-    B.cash = start_stack
-
-    hand_count,b = 0, 0
-
-    while A.cash > 0 and B.cash > 0:
-        hand_count += 1
-
-        if hand_count % hand_clock==0: 
-            b = b+1 if b < len(blinds)-1 else len(blinds)-1
-            
-        GLOBAL_TXT = gameplay(DECK, P[0],P[1], blinds[b])
-
-        # Allow the players to view the end result
-        board = [DECK[n] for n in xrange(4,9)]
-        flop,turn,river = board[:3], board[3:4], board[4:5]
-        if not A.FOLD and not B.FOLD:
-            GP("INFO ",A.name, pp_hand(A.hole), pp_score(A), ' ',A.cash)
-            GP("INFO ",B.name, pp_hand(B.hole), pp_score(B), ' ',B.cash)
-        GP("INFO GAMEOVER ", hand_count)
-        for p in P: 
-            if p.brain: 
-                p.GP_FLUSH(returnGP())
-                p.GP_BUFFER = []
-          
-        # Human player text
-        if not A.brain or not B.brain: # or True:
-            for g in GLOBAL_TXT: print g
-            print "INFO BOARD ", pp_hand([DECK[n] for n in xrange(4,9)])
-
-        P = [P[-1]] + P[:-1] # Cycle the player order
-
-    if A.cash: print A.name, hand_count
-    else     : print B.name, hand_count
-
-for p in P: 
-    if p.brain: p.die() # Kill the players!
-
-
-
-