A clean model
The game logic lives in plain Swift types (a code, a guess and the match rules) with no UI inside. The views just render state.
There's quiet music on this site. It stays off unless you choose it, and it keeps playing as you move between pages.
A native Mastermind game for iPhone, built in SwiftUI. It started from a course assignment, and I added more than 20 colour and emoji themes, with zero dependencies.
The game logic lives in plain Swift types (a code, a guess and the match rules) with no UI inside. The views just render state.
Pegs can be colours or emoji, across 20+ themes, and the whole board restyles instantly.
The web version below uses the same rules. The real app is native SwiftUI.
Its sibling, CodeWordBreaker, swaps pegs for real English words.
