コード例 #1
0
ファイル: myTestCounts.py プロジェクト: jdimarco218/BjSim
    # Get inputConfigurationFile and outputFile
    inputConfigFile = sys.argv[1]

    # Input configuration must be python syntax to set values
    config = {}
    execfile(inputConfigFile, config)

    # Modify config to work for this test
    config["rounds_to_play"] = 1
    config["min_bet"] = 1
    config["num_decks"] = 2
    config["player_name_list"] = ["Felt", "HiLo", "Basic"]
    config["player_adjust_betting_list"] = ["Felt", "HiLo", "Basic"]

    bjsim = BjSimulation(config)
    bjsim.curr_game = GameState(bjsim.num_decks, bjsim.penetration_min,
                                bjsim.penetration_max)

    # Test different counts
    #######################

    # Simple count, 2
    bjsim.curr_game.shoe.cards[0] = Card(1, 2)
    bjsim.curr_game.shoe.popCard()
    assert (bjsim.curr_game.felt_run_count == 1)
    assert (bjsim.curr_game.felt_true_count == 0)
    assert (bjsim.curr_game.hilo_run_count == 1)
    assert (bjsim.curr_game.hilo_true_count == 0)
    # Simple count, 3
    bjsim.curr_game.shoe.cards[0] = Card(1, 3)
    bjsim.curr_game.shoe.popCard()
    assert (bjsim.curr_game.felt_run_count == 3)
コード例 #2
0
ファイル: myTestBlackjacks.py プロジェクト: jdimarco218/BjSim
    # Input configuration must be python syntax to set values
    config = {}
    execfile(inputConfigFile, config)

    # Modify config to work for this test
    config["rounds_to_play"] = 1
    config["min_bet"] = 1
    config["num_decks"] = 2
    config["starting_chips"] = [0, 0, 0]
    config["player_name_list"] = ["Basic", "Felt", "HiLo"]
    config["player_adjust_betting_list"] = ["Basic", "Felt", "HiLo"]
    config["num_players"] = 3

    bjsim = BjSimulation(config)
    bjsim.curr_game = GameState(bjsim.num_decks, bjsim.penetration_min, bjsim.penetration_max)

    # Increase the TC to 2 for advantage players
    ############################################

    # Rank 2 increases count by 1 for HiLo and Felt
    for i in range(2*bjsim.num_decks):
        bjsim.curr_game.shoe.cards[0] = Card(1, 2)
        bjsim.curr_game.shoe.popCard()
    assert(bjsim.curr_game.felt_run_count  == 2*bjsim.num_decks)
    assert(bjsim.curr_game.felt_true_count == 2)
    assert(bjsim.curr_game.hilo_run_count  == 2*bjsim.num_decks)
    assert(bjsim.curr_game.hilo_true_count == 2)
    
    #
    # TEST CASE