Müfredat Konuları

Shatranj.ai proje müfredatı lms.shatranj.ai üzerinden erişilebilir. lms.shatranj.ai

Aşağıda müfredat konularının kısa birer özeti yer almaktadır

 

Lesson 1 – Course Scope and Priorities

  • 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

Lesson 2 – Introduction to Computing & Python Setup

  • 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

Lesson 3 – Python Data Types

  • 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

Lesson 4 – Conditionals, Loops, Control Flow

  • Introduces logic, loops, and interactive programs.
  • If/elif/else logic
  • Boolean operations
  • For/while loops
  • Break/continue
  • Simple input programs

Lesson 5 – Functions, Scope, Parameters

  • Teaches modular code with functions.
  • Defining functions
  • Parameters and returns
  • Local/global scope
  • Lambdas
  • Small functional project (piece-value calculator)

Lesson 6 – Files, Exceptions, Libraries, Testing

  • Working with files and robust code.
  • File read/write
  • Try/except
  • Importing libraries
  • Simple testing
  • Handling invalid inputs

Lesson 7 – OOP, Classes, TicTacToe

  • First exposure to OOP.
  • Classes and objects
  • Attributes and methods
  • Game modeling
  • TicTacToe implementation
  • Debugging OOP code

Lessons 8 – Chess & Shatranj Board Representation

  • Board representations for chess and Shatranj
  • Coordinate systems and indexing strategies
  • Internal data structures for board state
  • UTF-8 and symbolic rendering of pieces
  • Integration with board editors and visualization tools

Lessons 9 – Piece Movement, Game State Updates, and Terminal Conditions

  • Piece movement rules in chess and Shatranj
  • Legal vs. pseudo-legal move generation
  • Updating game state after a move
  • Detecting check and illegal self-check
  • Detecting terminal conditions: checkmate and stalemate

Lessons 10 – Search Problems and Graph Traversal

  • Search problem formulation: states, actions, transitions, and goals
  • State-space graphs and trees
  • Depth-First Search (DFS)
  • Breadth-First Search (BFS)
  • Uniform-Cost Search (UCS)
  • Graph-tracing and visualization exercises
  • Simple chess and grid-based examples

Lessons 11 – Heuristic Search and Adversarial Game Trees

  • Heuristic functions and informed search
  • Admissibility and consistency
  • A* search
  • Adversarial search and game trees
  • Evaluation functions for game states
  • Minimax search
  • Expectiminimax for stochastic and uncertain environments
  • Alpha–beta pruning and performance enhancements
  • Evaluation functions for game states
  • Chess-based adversarial examples

Lesson 12 – Horse Tour (Knight’s Tour)

  • Explores Knight’s Tour with recursion and heuristics.
  • Knight graph movement
  • Open/closed tours
  • Backtracking with DFS
  • Warnsdorff heuristic
  • Connection to TSP

Lesson 13 – Eight Queens Puzzle

  • Constraint satisfaction with backtracking.
  • Queen attack logic
  • Recursive search
  • Optimization techniques
  • Historical queen references
  • Notebook implementations

Lesson 14 – Wheat & Chessboard Problem

  • Mathematical puzzles and exponential growth.
  • Doubling on chessboard
  • Powers of 2
  • Moving Mount Fuji type brainteaser puzzles used in interviews, applied math puzzles
  • Magic squares
  • Smullyan logic puzzles
  • Knight tile problems and other tile problems on the grid

Lesson 15 – Minimax, Alpha-Beta, Checkmate Logic

  • Deep adversarial search and chess endgames.
  • Minimax computation
  • Alpha-beta pruning
  • Opposition, triangulation
  • Historical sources (Al-Adli, Reti)

Lesson 16 – Suli’s Diamond (Historic Endgame Study)

  • Historic chess endgame analysis, endgame tablebases, dynamic programming, hashing
  • Al-Suli biography
  • Reconstruction of endgame
  • Opposition and triangulation
  • Corresponding squares theory
  • Dynamic Programming code solution to the 1000-year long dilemma in C/C++
  • Solution inspection at play.shatranj.ai and also via notebooks ascii boards

Lesson 17 – Customizing Stockfish to Play Shatranj, Rybka–Deep Blue–Stockfish Story

Explores how modern chess engines evolved and how open-source engines can be adapted to historical variants.

  • Deep Blue’s brute-force hardware search
  • Rybka and the rise of evaluation-centric engines
  • Stockfish as an open, community-driven engine
  • How Stockfish represents pieces, moves, and rules
  • Modifying piece movement (ferz, wazir), evaluation, legality rules
  • Building Shatranj-compatible search and evaluation

Lesson 18 – Reinforcement Learning Foundations: Gridworld, Dynamic Programming, and Complexity

Introduces reinforcement learning (RL) by solving a small gridworld exactly when the rules are known, then shows why this “all‑knowing” approach breaks for large games like chess.

  • Agent–environment loop; states, actions, rewards, episodes; discount factor γ.
  • Policy evaluation (“drifting robot”) and value iteration (“treasure hunter”) using Bellman backups.
  • Visual value propagation and deriving an optimal policy from the value function.
  • The curse of dimensionality: state‑space vs game‑tree complexity; Shannon number motivation.
  • Historical “giant games” (e.g., Tamerlane chess, Go) as context for why learning is needed.

Lesson 19 – The Frozen Rook: Tabular Q-Learning on FrozenLake

Moves from planning to learning: the agent starts with no map and learns a policy by trial and error using tabular Q-learning.

  • Formulate FrozenLake/Frozen Rook as an MDP: S, A, R, P, terminal states, γ.
  • Q-learning update rule and ε-greedy exploration (exploration→exploitation schedule).
  • Train an agent in Gymnasium FrozenLake; compare deterministic vs slippery transitions.
  • Inspect what was learned via Q-table heatmaps / policy arrows; tune α, γ, ε and episode counts.
  • Scaling lessons: sparse rewards, delayed credit, and why larger maps are harder.

Lesson 20 – Two Rook Checkmate vs. Lone King: Temporal-Difference Learning in Practice

Applies Q-learning to a small chess endgame and makes the RL codebase “real” by separating the experiment notebook from the learning and training modules.

  • Temporal-Difference (TD) learning: identify the TD error inside the Q-learning update; why TD updates during play.
  • Why Monte Carlo learning is too slow for chess-like, delayed-reward games.
  • Engineering stack: rl.py (Q-memory + TD update), trainer.py (episode loop, exploration schedule), notebook as the lab.
  • Encode chess positions as machine-readable state (FEN) and train a tabular agent on a bounded endgame/puzzle state space.
  • Limits: why tabular methods fail for full chess (curse of dimensionality) and the need for function approximation.

Lesson 21 – Deep Q-Networks: From Q-Tables to Neural Networks

Introduces function approximation for RL by replacing the Q-table with a neural network (DQN) and applying it to several small board games.

  • Why Q-tables don’t scale: too many states; generalization requires a model that can “guess” values for unseen positions.
  • Deep Q-Network (DQN) training loop: replay buffer, target network, mini-batch updates, ε-decay.
  • Implement and experiment with DQN on games such as Connect-4 (4Connect), Fox & Hounds, and Othello/Reversi.
  • Diagnostics: learning curves, stability issues (overestimation, divergence) and practical mitigations.
  • Compare approaches: DQN vs NNUE-style evaluation and handcrafted evaluation (HCE) to discuss architecture tradeoffs.

Lesson 22 – Monte Carlo Rollouts and MCTS on Qirkat

Builds a complete Qirkat environment and then progresses from random rollouts to full Monte Carlo Tree Search (MCTS) with UCT selection.

  • Implement Qirkat rules backbone (5×5 board, C3 empty) and the maximum-capture rule that forces capture sequences.
  • Move generation that enumerates capture lines, enforces compulsory capture, and filters to maximum-length captures.
  • Monte Carlo baselines: random rollouts and flat Monte Carlo move evaluation before adding tree reuse.
  • MCTS pipeline: selection, expansion, rollout/evaluation, backpropagation; UCT/visit-count final move choice.
  • Reproducible game logs and audit tooling for step-by-step playback and debugging.

Lesson 23 – AlphaZero on Qirkat: PUCT, Policy/Value Nets, and Self-Play

Upgrades MCTS into AlphaZero-style search by adding a neural network that supplies a policy prior and a value estimate, then trains through self-play.

  • Bridge intuition with a tiny ‘Connect2’ AlphaZero demo, then transfer the ideas to Qirkat.
  • Replace UCT with PUCT: combine visit statistics with a learned policy prior to guide exploration.
  • Neural network heads: policy (move probabilities) and value (position evaluation) used in place of random rollouts.
  • AlphaZero loop: self-play → training targets (π, z) → network update → repeat; evaluate via tournament matches/logs.
  • Path-aware move encoding for variable-length capture sequences so different capture paths remain distinct.

Lesson 24 – Turkish Checkers (Dama): Engine, Alpha-Beta, and MCTS Match Harness

Implements Turkish Checkers and compares classical search (alpha–beta) with MCTS using a reusable match runner and batch simulation logs.

  • Game engine: board representation, legal moves with multi-jump captures, and move-path encoding.
  • Evaluation function plus Negamax/Alpha-Beta search agent; depth vs strength tradeoffs.
  • MCTS agent for Turkish Checkers and head-to-head comparisons against alpha–beta.
  • Universal match runner (play_game) and batch simulation utilities for reproducible experiments.
  • Exportable logs (zipped) for classroom review and debugging.