The ChessAIThon project (2025-1-ES01-KA220-VET-000354329) is co-funded by the European Union. The views and opinions expressed in this publication are those of the author(s) only and do not necessarily reflect those of the European Union or the Spanish Service for the Internationalisation of Education (SEPIE). Neither the European Union nor the National Agency SEPIE can be held responsible for them.
Table of Contents
The Chapter addresses the following contents
Paragraph 1 The Chessboard as a Data Structure: Addresses learning how to translate a real-world object (the chessboard) into a format that a computer can understand and manipulate. Contents are not for building a complete game engine yet; rather, learning to help students think like a programmer.
Paragraph 2 The Logic of Movement - Understanding Control Flow and Conditional Blocks: A computer program does not simply execute instructions from top to bottom; it must make decisions. In chess, you cannot move a piece wherever you want: strict rules exist. In computer science, these rules translate into Control Flow and Conditional Logic. The contents address how to learn to tell the computer: "If this happens, do this; otherwise, do that."
Paragraph 3 Moves and Rules – Modularity and Functions: addresses the issue on teaching how to break down a problem into subproblems, each solved by a specific function.
Parapgraph 4 Chess moves and validity checks as algorithms: addressing how to use loops to “scan” the chessboard and apply a linear search algorithm to detect any obstacles along a piece’s path, between the starting square and the destination square. In this way, preventing the rook from moving vertically or horizontally when there is a pawn in its way becomes possible
Paragraph 5 Towards AI – The Logic of Chess: addressing the difference between a computer that only knows how to move pieces, that is a "digital chessboard" and a computer that knows how to choose a move, that is an Artificial Intelligence. The last paragraph explores how computers "think" about the future, generating possibilities and predicting consequences. Finally, it builds a small "Solver" capable of finding a checkmate in 1 move. The paragraph represents the culmination of the journey: moving from checking whether a move is valid (defense) to actively seeking the best move (attack), entering the domain of Artificial Intelligence (AI).