1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { agentHandler } from "https://esm.town/v/saolsen/gameplay_agent";
import { GameKind, JsonObject } from "https://esm.town/v/saolsen/gameplay_games";
import {
PokerActionKind,
PokerAgentResponse,
PokerView,
} from "https://esm.town/v/saolsen/gameplay_poker";
function fold_action(
view: PokerView,
_agent_data?: JsonObject,
): PokerAgentResponse {
if (view.rounds[view.round].bet === 0) {
return { action: { kind: PokerActionKind.Check } };
}
return { action: { kind: PokerActionKind.Fold } };
}
export default agentHandler(
[
{
game: GameKind.Poker,
agentname: "folds",
agent: fold_action,
},
],
);