Verse Library verse

05 Fragment

Defines state-modifying functions with transaction safety. Use for scoring and game logic.

verse-library/verse-the-important-rules/05-fragment.verse

# Validate FIRST, then act — so you never leave the game half-changed
AwardWin(Winner : agent)<transacts> : void =
    if (RoundActive?, not GameOver?):
        set GameOver = true
        set CurrentScore += 1

Comments

    Sign in to vote, comment, or suggest an edit. Sign in