Improve AgentOfChaos documentation
parent
194f962746
commit
220c956ba0
|
|
@ -32,7 +32,7 @@ class AgentOfChaos(Agent):
|
|||
|
||||
def __init__(self) -> None:
|
||||
"""
|
||||
Create a new instance of the agent of chaos.
|
||||
Agent that always tries to make a "random" move.
|
||||
"""
|
||||
super().__init__(
|
||||
name="Agent of chaos",
|
||||
|
|
@ -65,4 +65,14 @@ def play_tic_tac_toe(payload : Payload) -> Payload:
|
|||
return { "move": random.choice(options) }
|
||||
|
||||
def play_royal_game_of_ur(payload : Payload) -> Payload:
|
||||
return { "move": random.choice(payload.get("valid_moves", [""])) }
|
||||
"""
|
||||
The royal game of Ur already returns a set of valid moves.
|
||||
|
||||
We can lazily just pick one of these options and return it.
|
||||
|
||||
:param payload: The incoming game state.
|
||||
:type payload: dict[str, Any]
|
||||
:return: The agent of chaos' random choice
|
||||
:rtype: dict[str, Any]
|
||||
"""
|
||||
return { "move": random.choice(payload.get("valid_moves", [""])) }
|
||||
|
|
|
|||
Loading…
Reference in New Issue