Skip to content
Game 5 Unit 23 of 128 1 hr learning time

Board Size Variation

Implement 6×6 board option for quicker games and strategic variety.

18% of Ink War

Board size affects game length and strategy. A 6×6 board (36 cells) creates faster games than 8×8 (64 cells).

Run It

pasmonext --sna inkwar.asm inkwar.sna

Unit 23 Screenshot

Version shows “PHASE 2 V0.7”.

Variable Board Size

Key changes needed:

ComponentAdjustment
DrawingDifferent board dimensions
BoundariesCursor limits change
Win detectionTotal cells changes (36 vs 64)
AI logicAdjacency calculations adjust

Implementation Approach

Use a board_size variable:

board_size:     defb    8       ; 6 or 8

; Use throughout code:
            ld      a, (board_size)
            ld      b, a            ; Loop counter for rows/cols

The Complete Code

What You’ve Learnt

  • Parameterised drawing - Flexible board dimensions
  • Variable bounds checking - Dynamic cursor limits
  • Game variants - Simple options add replay value

What’s Next

Unit 24 adds an optional move timer for faster-paced games.

What Changed

Unit 22 → Unit 23