Ejemplo n.º 1
0
def dealerPlayTest(num):
    RandomGen = rg.RandomGenerator(num)
    shoe = c.Shoe(8, RandomGen)
    card1 = shoe.getCard()
    card2 = shoe.getCard()
    print(card1, card2)
    print(g.dealerPlay(card1, card2, shoe))
Ejemplo n.º 2
0
if restart == True:
    spot = pickle.load(open("spot.p", "rb"))
elif restart == False:
    spot = {'block': 0, 'val': 0}
else:
    restart = True
    spot = {'block': 0, 'val': 0}
pickle.dump(spot, open("spot.py", "wb"))

HardLogic = lg.HardLogic(restart)
SoftLogic = lg.SoftLogic(restart)
SplittingLogic = lg.SplittingLogic(restart)
FirstCardLogic = lg.FirstCardLogic(restart)

RandomGen = rg.RandomGenerator(randomNumberSeed)
Strategy = st.Strategy(SplittingLogic.splittingTest, SoftLogic.softTest,
                       HardLogic.hardTest, FirstCardLogic.firstTest)

starttime = time.time()
payOff = []
for q in range(1, games):
    payOff.append(g.game(hands, decks, Strategy, RandomGen))

incumbent = sum(payOff) / len(payOff)
print(
    "intial incumbent established " + str(time.time() - starttime) + " value=",
    str(incumbent))

if spot['block'] < 1:
    if spot['val'] == 0:
Ejemplo n.º 3
0
import randomGen as r
import cards as c

gen = r.RandomGenerator(6)

shoe = c.Shoe(8, gen)

for i in range(0, 416):
    x = shoe.getCard()
    print(x)
Ejemplo n.º 4
0
import randomGen as r
import matplotlib.pyplot as plt

a = r.RandomGenerator(4509)

testArray = [0] * 450
postion = []
for i in range(0, 450):
    postion.append(i)

for i in range(0, 10000000):
    testArray[a.genNext(416)] += 1

for i, idata in enumerate(testArray):
    print(idata)
    print(postion[i])

plt.plot(postion, testArray)
plt.show()