From da9fd37d35e2dfe3cb7c4e602aa3ab4e63c928ec Mon Sep 17 00:00:00 2001 From: Madhu Date: Tue, 14 Jan 2025 22:34:48 +0530 Subject: [PATCH] final changes1 --- ai_agent_tutorials/ai_chess_game/ai_chess_agents.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py b/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py index b27f964..cb59e40 100644 --- a/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py +++ b/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py @@ -220,9 +220,16 @@ The game is managed by a **Game Master** that: ) st.markdown(chat_result.summary) + # Display the move history (boards for each move) st.subheader("Move History") for i, move_svg in enumerate(st.session_state.move_history): - st.write(f"Move {i + 1}") + # Determine which agent made the move + if i % 2 == 0: + move_by = "Agent White" # Even-indexed moves are by White + else: + move_by = "Agent Black" # Odd-indexed moves are by Black + + st.write(f"Move {i + 1} by {move_by}") st.image(move_svg) if st.button("Reset Game"):