Pairs Showtime (five growing boards, streaks, Drift/Bumble/Zip special cards, the rare wizard; own High Scores) and Family Play for 2 to 4 players

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 09:55:57 +00:00
co-authored by Claude Opus 5.5
parent 24e4b54d07
commit d8e4cce96b
4 changed files with 225 additions and 55 deletions
@@ -155,4 +155,32 @@ class PairsPatienceTest {
val after = uncover.point(h.from).press().point(h.to).press()
assertEquals(2, after.piles[7].size); assertTrue(after.piles[6].single().up)
}
// ---------- Pairs Showtime and Family Play (Phase 2) ----------
@Test fun showtimeHasOneSpecialPairFromTheSecondBoard() {
val r = java.util.Random(8)
assertTrue(showtimeFaces(0, 6, r).none { it < 0 })
val second = showtimeFaces(1, 8, r)
assertEquals(8, second.size); assertEquals(1, second.count { it < 0 }); assertEquals(8, second.toSet().size)
// Over many boards the specials take turns, and the wizard turns up only rarely.
val specials = (1..400).map { b -> showtimeFaces(b, 10, java.util.Random(b.toLong())).first { it < 0 } }
assertTrue(specials.count { it == PAIRS_WIZARD } in 4..40)
assertTrue(listOf(PAIRS_DRIFT, PAIRS_BUMBLE, PAIRS_ZIP).all { it in specials })
}
@Test fun streaksMultiplyAndDriftsSwapKeepsThePairs() {
assertEquals(100, showtimePoints(1)); assertEquals(300, showtimePoints(3))
val g = PairsGame.deal(java.util.Random(3), 6, 4)
val swapped = g.swap(0, 5)
assertEquals(g.cards[0], swapped.cards[5]); assertEquals(g.cards[5], swapped.cards[0])
assertEquals(g.cards.sorted(), swapped.cards.sorted())
assertEquals(12, g.hidden.size)
}
@Test fun familyPlayIsTwoToFourPlayersAndKeepsNoTable() {
assertEquals(listOf(2, 3, 4), PairsMode.entries.filter { it.family }.map { it.players })
assertFalse(PairsMode.Classic.family)
assertEquals(listOf("Pairs", tv.orbit.classic.arcade.PAIRS_CHALLENGE_SCORES, tv.orbit.classic.arcade.PAIRS_SHOWTIME_SCORES), tv.orbit.classic.arcade.scoreTables("Pairs"))
}
}
@@ -90,7 +90,7 @@ class TitleTextFitsTest {
@Test fun theModeButtonSpellsEachModeOutInFull() {
// The mode's whole name on the button, after its ◆, in the title's 210 dp column.
val label = Font(Font.SANS_SERIF, Font.BOLD, 1).deriveFont(14f * 1.3f)
for (mode in listOf("Classic", "Signal Run", "Challenge", "Challenges", "40-Line Sprint", "Daily Challenge", "Daily · Draw Three")) {
for (mode in listOf("Classic", "Signal Run", "Challenge", "Challenges", "40-Line Sprint", "Daily Challenge", "Daily · Draw Three", "Orbit Deck", "Showtime") + tv.orbit.classic.PairsMode.entries.map { it.title }) {
val w = width(label, "◆ $mode")
assertTrue("Mode · $mode is ${"%.0f".format(w)} dp", w <= 230 - 2 * 12 - 4)
}