Koi-Koi is a Japanese card game for two players, played with a 48-card hanafuda deck: 12 suits named after the months, four cards each. A full game is up to 12 rounds, one per month. You play a card from your hand and match it to a table card of the same month. The cards you collect can form scoring combinations called yaku. Once you complete a yaku, you can stop and score the round. Or you can say "koi-koi" and keep playing for a bigger score. Your opponent then plays on, and if they complete a yaku first, you score nothing and they get double their points.
I built a digital version for iPhone, iPad and Mac, with a computer opponent in three levels. The hard part is not the rules. It is that the opponent plays a game with hidden information. It cannot see your hand or the draw pile, and a bot that quietly reads them is easy to write and easy to miss in testing.
So the project treats "the computer never peeks" as a requirement, and checks it in code, in tests, and in the verify script.…