From 220c956ba0986e1341391dea0a310c96c3f00ddb Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Wed, 1 Jul 2026 22:45:39 +0200 Subject: [PATCH] Improve AgentOfChaos documentation --- agents/chaos.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/agents/chaos.py b/agents/chaos.py index 7e4a74d..0c5349f 100644 --- a/agents/chaos.py +++ b/agents/chaos.py @@ -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", [""])) } \ No newline at end of file + """ + 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", [""])) }