|
|
@ -27,7 +27,8 @@ |
|
|
|
cards_remaining, % 剩余手牌数 |
|
|
|
num_greater_cards, % 比上家大的牌数量 |
|
|
|
control_factor, % 控制因子 |
|
|
|
must_play = false % 是否必须出牌 |
|
|
|
must_play = false, % 是否必须出牌 |
|
|
|
game_stage = early_game % 游戏进度 |
|
|
|
}). |
|
|
|
|
|
|
|
%% 初始化AI状态 |
|
|
@ -111,11 +112,11 @@ select_best_play(Context, AIState) -> |
|
|
|
analyze_components(Cards) -> |
|
|
|
GroupedCards = group_cards_by_value(Cards), |
|
|
|
#{ |
|
|
|
singles => find_singles(GroupedCards), |
|
|
|
pairs => find_pairs(GroupedCards), |
|
|
|
triples => find_triples(GroupedCards), |
|
|
|
singles => game_logic:find_singles(GroupedCards), |
|
|
|
pairs => game_logic:find_pairs(GroupedCards), |
|
|
|
triples => game_logic:find_triples(GroupedCards), |
|
|
|
sequences => find_sequences(GroupedCards), |
|
|
|
bombs => find_bombs(GroupedCards) |
|
|
|
bombs => game_logic:find_bombs(GroupedCards) |
|
|
|
}. |
|
|
|
|
|
|
|
%% 计算手牌价值 |