File size: 3,171 Bytes
3c88a0f
 
 
 
1
2
3
4
5
{"type": "session", "harness": "my-agent", "id": "chess-0110", "name": "New session"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}}
{"type": "message", "message": {"role": "user", "content": "How do i play chess?"}}
{"type": "message", "message": {"role": "assistant", "content": "Chess is a two-player game played on an 8×8 board. White moves first, then players alternate turns. The goal is to **checkmate** the opponent’s king.\n\n## Setup\n- Each side has 16 pieces: 8 pawns, 2 rooks, 2 knights, 2 bishops, 1 queen, 1 king.\n- Place them on the two back rows:\n  - Back row: **Rook, Knight, Bishop, Queen, King, Bishop, Knight, Rook**\n  - Front row: 8 pawns\n- The queen starts on her own color: white queen on a white square, black queen on a black square.\n\n## How pieces move\n- **Pawn**: Moves forward 1 square. On its first move, it may move 2 squares. It captures diagonally forward 1 square. It cannot capture straight ahead.\n- **Knight**: Moves in an “L”: 2 squares one way, then 1 square perpendicular. It can jump over pieces.\n- **Bishop**: Moves any number of squares diagonally.\n- **Rook**: Moves any number of squares horizontally or vertically.\n- **Queen**: Moves any number of squares horizontally, vertically, or diagonally.\n- **King**: Moves 1 square in any direction. The king can never move into a square where it can be captured.\n\n## Capturing\nIf you move onto a square occupied by an opponent’s piece, you capture it and remove it from the board. You cannot capture your own pieces.\n\n## Check and checkmate\n- **Check**: Your king is under attack. You must get out of check by moving the king, capturing the attacking piece, or blocking the attack.\n- **Checkmate**: The king is in check and there is no legal way to escape. The game ends and that player wins.\n- **Stalemate**: A player has no legal moves but is not in check. The game is a draw.\n\n## Special moves\n- **Castling**: The king moves 2 squares toward a rook, and the rook jumps to the other side of the king. It only works if neither piece has moved, the squares between them are empty, the king is not in check, and the king does not pass through or land on an attacked square.\n- **En passant**: If an opponent’s pawn moves 2 squares from its starting position and lands beside your pawn, you may capture it as if it had moved only 1 square. You must do this immediately on your next move.\n- **Promotion**: If a pawn reaches the last rank, it must become a queen, rook, bishop, or knight. Most players choose a queen.\n\n## How to win\n- Checkmate your opponent’s king.\n- You can also win if your opponent resigns or runs out of time in a timed game.\n- Draws happen by stalemate, agreement, insufficient material, threefold repetition, or the 50-move rule."}}