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", [""])) }