SECTION 1 — Foundations & Python Basics (Lessons 1–7)
-
1Lesson 1 – Project and Curriculum Scope and Priorities
Summary: Introduces Shatranj.AI project, Erasmus+ foundations, partner organizations, digital platforms.
- Introduces the Shatranj.AI project, its Erasmus+ foundations, partner organizations, and digital platforms.
- Project vision, Erasmus KA2 context
- Partner institutions and cultural heritage focus
- Overview of platforms (editor, LMS, code tools)
- Teacher roles and student outcomes
- Curriculum structure overview
- Python/Jupyter introduction
-
2Lesson 2 – Introduction to Computing & Python Setup
Basic computing concepts and Python/Jupyter installation.
Login required to access full content.- Students learn core computing concepts and set up Python/Jupyter.
- CPU, RAM, I/O basics
- Bits, bytes, binary representation
- JupyterLab installation
- First Python notebook execution
- Variables, simple expressions
- Access to Drive folders
-
3Lesson 3 – Python Data Types
Numbers, strings, lists, and essential data handling in Python.
Login required to access full content.- Covers Python’s built‑in data types and basic operations.
- Integers, floats, strings, booleans
- Type conversion
- Lists and indexing
- Mutability concepts
- Chess-pieces-as-strings exercises
-
4Lesson 4 – Conditionals, Loops, Control Flow
If/else logic, loops, and control flow fundamentals.
Login required to access full content.- Introduces logic, loops, and interactive programs.
- If/elif/else logic
- Boolean operations
- For/while loops
- Break/continue
- Simple input programs
-
5Lesson 5 – Functions, Scope, Lambda
Writing functions, parameters, returns, and variable scope.
Login required to access full content.- Teaches modular code with functions.
- Defining functions
- Parameters and returns
- Local/global scope
- Lambdas
- Small functional project (piece-value calculator)
-
6Lesson 6 – Files, Exceptions, Libraries, Testing
Reading/writing files, handling errors, and using libraries.
Login required to access full content.- Working with files and robust code.
- File read/write
- Try/except
- Importing libraries
- Simple testing
- Handling invalid inputs
Section 2: Object-Oriented Programming & Board Game Modeling
Section 3: Chess Foundations & Engine Code
-
8Lesson 8– Chess & Shatranj Code Foundations
Board representation and basic piece movement logic.
Login required to access full content.- Students start building engine components.
- Board representations
- Piece movement basics
- UTF-8 rendering
- Chess board editor tools
- Printing and moving pieces
-
9Lesson 9– Chess & Shatranj Code Foundations
Board representation and basic piece movement logic.
Login required to access full content.- Students start building engine components.
- Board representations
- Piece movement basics
- UTF-8 rendering
- Chess board editor tools
- Printing and moving pieces
Section 4: Classical and Adverserial Search Algorithms
-
10Lesson 10– Search Algorithms / Adversarial Search
DFS, BFS, UCS, and A* search foundations.
Login required to access full content.- Core AI search algorithms for games.
- Search problem structure
- DFS, BFS, UCS
- A* and heuristics
- Minimax introduction
- Pacman/chess examples
- Graph-tracing exercises
-
11Lesson 11 – Search Algorithms / Adversarial Search
Recursion, backtracking, and heuristic solutions.
Login required to access full content.- Explores Knight’s Tour with recursion and heuristics.
- Knight graph movement
- Open/closed tours
- Backtracking with DFS
- Warnsdorff heuristic
- Connection to TSP
Section 5: Solving Ancient Chess Puzzles with AI algorithms
-
12Lesson 12 – Horse Tour (Knight’s Tour)
Recursion, backtracking, and heuristic solutions.
Login required to access full content.- Explores Knight’s Tour with recursion and heuristics.
- Knight graph movement
- Open/closed tours
- Backtracking with DFS
- Warnsdorff heuristic
- Connection to TSP
-
13Lesson 13 – Eight Queens Puzzle
Backtracking and constraint-based problem solving.
Login required to access full content.- Constraint satisfaction with backtracking.
- Queen attack logic
- Recursive search
- Optimization techniques
- Historical queen references
- Notebook implementations
-
14Lesson 14 – Wheat & Chessboard Problem
Exponential growth and classic logic puzzles.
Login required to access full content.- Mathematical puzzles and exponential growth.
- Doubling on chessboard
- Powers of 2
- Magic squares
- Smullyan logic puzzles
-
15Lesson 15 – Rumi's mate from Spain - Minimax, Alpha-Beta, Checkmate Logic
Advanced search, pruning, and checkmaet logic.
Login required to access full content.- Deep adversarial search and chess endgames.
- Minimax computation
- Alpha-beta pruning
- Opposition, triangulation
- Historical sources (Al-Adli er-Rumi, Alfonso's book)
Section 6: Dynamic Programming
Section 7: The intertwined history of artificial intelligence and modern chess software
Section 8: Reinforcement Learning
-
18Lesson 18 – Reinforcement Learning with OpenAI Gym (Rook Pathfinding)
Rook pathfinding and reinforcement learning basics.
Login required to access full content.Introduces RL concepts using a simple OpenAI Gym–style gridworld based on rook movement.
- Agent–environment loop
- States, actions, rewards, episodes
- Q-learning and ε-greedy exploration
- Rook navigation on an 8×8 board
- Reward shaping and sparse reward issues
- Visualizing policy improvement step-by-step
-
19Lesson 19 – Games Suitable for Reinforcement Learning
Which games can be built using reinforcement learning.
Login required to access full content.Overview of small, medium, and complex games that students can use to implement RL algorithms.
- TicTacToe, Connect-4, Gridworld
- Snake, Pacman, Othello/Reversi
- Mini-chess and other board variants
- State space vs. reward density considerations
- Matching games with RL methods (Q-learning, MC, DQN, MCTS)
- Choosing project-friendly RL environments
-
20Lesson 20 – Reinforcement Learning: Two-Rook Checkmate
Training an RL agent to perform classical checkmate.
Login required to access full content.Applies RL to a structured chess endgame where the agent must learn the coordinated 2-rook mating pattern.
- Environment design and state encoding
- Sparse rewards and reward shaping for endgames
- Learning piece coordination and zugzwang patterns
- Progressive improvement through self-play
- Visualizing trajectories toward checkmate
- Bridge to AlphaZero-style self-play and value learning
-
21Lesson 21 – AlphaZero
MCTS, neural networks, and building mini-AlphaZero.
Login required to access full content.Minimax & Alpha-Beta (bridging classic AI and RL)
- Why pure RL struggles with deep tactics
- Why humans and engines search
- Teach minimax, alpha-beta
- Connect to MCTS logic (search tree with value estimates)
- Very important bridge: AlphaZero = RL + MCTS + neural nets
Introduction to policy/value functions
- States → value
- States → probability distribution over moves
- Explain why tabular methods fail in full chess
- Show that we need function approximation
- Introduce NNEU concept here:
What is NNEU?
– neural network evaluation unit
– a neural net replacing hand-coded evaluation
– outputs value (who is better)
– outputs policy (what moves are likely good)
The students don’t need deep math; only intuition
Deep Q-Learning (DQN) with simple games
- Use Snake or Catch
- Teach replay buffer, target network
- Show why DQN does NOT work for chess (action space too large), preparing AlphaZero.
Policy gradient & actor-critic basics
(Short overview, not too mathematical)
- Policy gradient: learn policy directly
- Actor-critic: policy (actor) + value estimate (critic)
- Prepare students for AlphaZero’s architecture (policy + value output).
Monte Carlo Tree Search (full lesson)
- Expand nodes
- Simulate
- Backup values
- Choose action using visit counts
- Show how policy prior improves MCTS
- Show how MCTS improves the policy network → the AlphaZero training loop emerges
Putting it all together: the AlphaZero algorithm
- Self-play generates games
- MCTS guided by neural net creates improved policy
- Neural net trained on (state, policy_targets, value)
- Iteration of self-play → training → stronger MCTS → stronger games
- Show how AlphaZero solves simple mini-chess (4×4, 5×5)
- Connect back to your 2-rook checkmate lesson
Students now understand:
– how RL can solve small tasks
– why full chess needs powerful NNEUs, MCTS, and self-play
Build a mini AlphaZero for Connect-4 or MiniChess
- Connect-4 board is perfect for classroom AlphaZero demo
- Implement:
– neural net (small CNN or MLP)
– MCTS
– self-play training
Lc0 is a direct open-source implementation inspired by DeepMind's AlphaZero project, and it has far exceeded its success in chess.
https://lczero.org/




