A pure function takes game data in, transforms it, and produces output using only its inputs. It avoids external dependencies such as a Game singleton, so identical inputs produce identical results. section 5.1.1
For game logic:
- Pass required data in explicitly, such as Balance and GameData; keep logic functions independent of the singleton and Board. section 5.1.1 section 5.4
- For pseudo-random behavior, pass a seed so the function returns the same result for the same input. section 5.1.1
Test game logic
Create GameData and Balance directly, call a static logic function, and verify the changes without setting up a Unity scene or Game singleton. section 5.1.1
Figure 5.13 The core gameplay architecture. Game takes in Balance and calls Board. Board takes in Input and calls Logic. Logic runs on arrays of data from GameData, which Board and Game then use to show the player what happened.

The diagram shows Logic between Board input and the game data it transforms. section 5.4






















