Syllabus

  1. 01The boardPlan the game, represent the grid as a list of lists (avoiding the shared-row trap), and draw it as text.4 lessons
    1. 01The game and the plan
    2. 02The board as a list of lists
    3. 03Drawing the board
    4. 04The board quiz
  2. 02Making movesDrop pieces with gravity, reject full columns and bad input with clear messages, and alternate between the two players.4 lessons
    1. 01Dropping a piece
    2. 02Validating what players type
    3. 03Taking turns
    4. 04Making moves quiz
  3. 03Winning the gameDetect lines of four in every direction, recognize draws, run the full game loop with input handling, and add computer opponents that play randomly and by simple rules.7 lessons
    1. 01Horizontal and vertical wins
    2. 02Diagonals and direction vectors
    3. 03Full boards and draws
    4. 04The game loop
    5. 05A random opponent
    6. 06A rule-based opponent
    7. 07Winning the game quiz
  4. 04Looking aheadScore a position with a simple evaluation, then add a minimax search so the computer opponent can plan a few moves ahead.3 lessons
    1. 01Scoring a position
    2. 02Looking ahead with minimax
    3. 03Looking ahead quiz