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

Practice Mode

Add practice mode with undo functionality for learning and experimentation.

22% of Ink War

Practice mode lets players experiment without consequences—perfect for learning strategy.

Run It

pasmonext --sna inkwar.asm inkwar.sna

Unit 28 Screenshot

Version shows “PHASE 2 V0.12”.

Undo Implementation

Store the previous state before each move:

undo_row:       defb    0
undo_col:       defb    0
undo_player:    defb    0
undo_available: defb    0

; Before claiming:
            call    save_undo_state

; On U key:
            call    restore_undo_state

Design Decisions

ChoiceRationale
One level undoSimple to implement
Two-player onlyAI shouldn’t be undone
Visual feedbackFlash on undo
Key ‘U’Intuitive

The Complete Code

What You’ve Learnt

  • State history - Storing previous game state
  • Undo mechanics - Restoring state on demand
  • Learning aids - Helping new players improve

What’s Next

Unit 29 adds configurable control schemes.

What Changed

Unit 27 → Unit 28