Modern Apps git

← Modern-Apps.git

solitaire: show Klondike stock passes in options and on the board (#911)

Commit
d7c7bea2f1ee8afedc9e713ae01f7232118bb0df
Author
Vayun Mathur <[email protected]>
When
2026-11-12 17:36 UTC (23 days ago)
Parents
a4165a3
Request: #911 asks to choose how many times the Klondike stock can be
recycled (the common variants: unlimited, 3, or a single pass) when
starting a game.

Current state: the choice already existed but was invisible as such.
KlondikeDifficulty maps Relaxed to unlimited, Regular to 3 passes and
Hard to 1 pass (data/GameState.kt), and the New Game dialog offered
"Relaxed / Regular / Hard" without saying that this is the recycle
count. Once the stock ran out, the empty slot was blank, so there was
no way to see how many passes were left (Pyramid shows a ↻).

Changes:
- New Game dialog: the Klondike difficulty row is now a "Passes
  through the stock" row with the options ∞ / 3 / 2 / 1. The caption
  carries the meaning so each segment can be just the count, which
  keeps four options on one row of a phone dialog (spelled-out labels
  plus the selected check mark did not fit). Each segment's spoken
  label is the full phrase ("Unlimited passes", "3 passes", "1 pass")
  via a plurals resource.
- New "2 passes" option: KlondikeDifficulty.TWO_PASSES (1 redeal),
  appended to the enum. The enum names make up the persisted stats key
  (DRAW_ONE_REGULAR etc., SolitaireKlondikeOps), so existing names and
  order are untouched and no migration is needed; the new option gets
  its own DRAW_*_TWO_PASSES stats bucket and still counts toward the
  Klondike totals. The dialog order lives in KLONDIKE_DIFFICULTY_ORDER
  and passes() derives the count from redeals().
- Board: the empty Klondike stock shows "↻ n" with the passes still to
  come, a bare "↻" in unlimited games, and stays blank (and no longer
  tappable) when nothing can be recycled. Its spoken label is "n
  passes left" / "Unlimited passes".
- Strings: new ones in values/ only, translations fall back to English.
  The now unused difficulty_regular string is removed (values/ and its
  one translation, values-et).

User-visible effect: starting Klondike asks for "Passes through the
stock" (∞, 3, 2 or 1) instead of Relaxed/Regular/Hard; the default is
still 3. During play the empty stock shows how many recycles remain.

Verification: new KlondikeStockPassesTest (passes-left and label logic,
the board's empty stock text, description and tap, the dialog's four
options starting a 2-pass game) and SolitaireRulesTest additions (enum
names stay fixed, passes per option, dialog order, a 2-pass game
recycles exactly once). Container build of :games:solitaire:
compileDevKotlin and lint pass with no new findings; testDevUnitTest
runs 72 tests, all new ones pass, and the one failure,
DragAndViewModelTest.freeCellDropRejectsMultiCardDragOntoCell, also
fails on unmodified main. The store screenshots do not change: the
Klondike preview has a non-empty stock and the win preview has nothing
to recycle.

Diff

games/solitaire/src/main/java/com/vayunmathur/games/solitaire/data/GameState.kt
diff --git a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/data/GameState.kt b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/data/GameState.ktindex c6638ce58a..d92cd05637 100644--- a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/data/GameState.kt+++ b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/data/GameState.kt@@ -9,20 +9,37 @@ enum class GameMode { KLONDIKE, SPIDER, FREECELL, PYRAMID }  enum class DrawMode { DRAW_ONE, DRAW_THREE } -/** Klondike redeal difficulty: how many times the waste may be recycled. */-enum class KlondikeDifficulty { RELAXED, REGULAR, HARD }+/**+ * Klondike redeal difficulty: how many passes through the stock are allowed.+ *+ * The names are part of the persisted stats key (`<draw>_<difficulty>`, see+ * SolitaireKlondikeOps), so never rename them; append new values, never reorder.+ */+enum class KlondikeDifficulty { RELAXED, REGULAR, HARD, TWO_PASSES } -/** Redeals allowed for each difficulty (RELAXED is effectively unlimited). */+/** Redeals (waste recycles) allowed for each difficulty; RELAXED is unlimited. */ fun KlondikeDifficulty.redeals(): Int = when (this) {     KlondikeDifficulty.RELAXED -> Int.MAX_VALUE     KlondikeDifficulty.REGULAR -> 2   // 3 passes total+    KlondikeDifficulty.TWO_PASSES -> 1     KlondikeDifficulty.HARD -> 0      // single pass } +/** Passes through the stock for each difficulty, or null when unlimited. */+fun KlondikeDifficulty.passes(): Int? = redeals().takeIf { it != Int.MAX_VALUE }?.plus(1)++/** The New Game dialog's order: most passes first. */+val KLONDIKE_DIFFICULTY_ORDER: List<KlondikeDifficulty> = listOf(+    KlondikeDifficulty.RELAXED,+    KlondikeDifficulty.REGULAR,+    KlondikeDifficulty.TWO_PASSES,+    KlondikeDifficulty.HARD,+)+ /**  * Options chosen in the New Game dialog. Only the fields relevant to the chosen  * [GameMode] are used:- *  - Klondike: [drawMode] + [klondikeDifficulty] (Relaxed/Regular/Hard redeals).+ *  - Klondike: [drawMode] + [klondikeDifficulty] (unlimited / 3 / 2 / 1 passes).  *  - Spider: [spiderSuits] (1 = easy, 2 = medium, 4 = hard).  *  - Pyramid: [relaxed] (unlimited passes vs a single pass).  */
games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/KlondikeBoard.kt
diff --git a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/KlondikeBoard.kt b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/KlondikeBoard.ktindex 13507e6dea..5de5c05b22 100644--- a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/KlondikeBoard.kt+++ b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/KlondikeBoard.kt@@ -14,7 +14,12 @@ import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity+import androidx.compose.ui.res.pluralStringResource+import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.contentDescription+import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp+import com.vayunmathur.games.solitaire.R import com.vayunmathur.games.solitaire.data.DrawMode import com.vayunmathur.games.solitaire.data.KlondikeState import com.vayunmathur.games.solitaire.platform.SolitaireActions@@ -39,8 +44,18 @@ fun KlondikeBoard(state: KlondikeState, actions: SolitaireActions, modifier: Mod                         cardHeight = cardHeight                     )                 } else {+                    // Empty stock: show the passes still to come, like Pyramid's ↻ (#911).+                    val passesLeft = klondikePassesLeft(state)+                    val description = when (passesLeft) {+                        null -> ""+                        UNLIMITED_PASSES -> stringResource(R.string.passes_unlimited)+                        else -> pluralStringResource(R.plurals.stock_passes_left, passesLeft, passesLeft)+                    }                     EmptySlot(-                        modifier = Modifier.clickable { actions.drawFromStock() },+                        modifier = Modifier+                            .clickable(enabled = passesLeft != null) { actions.drawFromStock() }+                            .semantics { if (description.isNotEmpty()) contentDescription = description },+                        label = klondikeStockLabel(passesLeft),                         cardWidth = cardWidth,                         cardHeight = cardHeight                     )@@ -110,3 +125,23 @@ fun KlondikeBoard(state: KlondikeState, actions: SolitaireActions, modifier: Mod     } } +/** [klondikePassesLeft] value for a game with unlimited passes. */+internal const val UNLIMITED_PASSES = Int.MAX_VALUE++/**+ * Passes through the stock still to come once the current one ends: null when the+ * empty stock cannot be recycled (no redeals left, or nothing in the waste),+ * [UNLIMITED_PASSES] for unlimited games, else the count.+ */+internal fun klondikePassesLeft(state: KlondikeState): Int? = when {+    state.waste.isEmpty() || state.redealsRemaining <= 0 -> null+    state.redealsRemaining == Int.MAX_VALUE -> UNLIMITED_PASSES+    else -> state.redealsRemaining+}++/** Empty-stock label: blank when it cannot recycle, ↻ when unlimited, else "↻ n". */+internal fun klondikeStockLabel(passesLeft: Int?): String = when (passesLeft) {+    null -> ""+    UNLIMITED_PASSES -> "↻"+    else -> "↻ $passesLeft"+}
games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt
diff --git a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.ktindex e1d47ede87..672746e7ac 100644--- a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt+++ b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt@@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import com.vayunmathur.library.ui.ExperimentalMaterial3Api+import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.R as UiR import com.vayunmathur.library.ui.SegmentedButton import com.vayunmathur.library.ui.SegmentedButtonDefaults@@ -16,13 +17,18 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier+import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.contentDescription+import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp import com.vayunmathur.games.solitaire.R import com.vayunmathur.games.solitaire.data.DrawMode import com.vayunmathur.games.solitaire.data.GameConfig import com.vayunmathur.games.solitaire.data.GameMode+import com.vayunmathur.games.solitaire.data.KLONDIKE_DIFFICULTY_ORDER import com.vayunmathur.games.solitaire.data.KlondikeDifficulty+import com.vayunmathur.games.solitaire.data.passes import com.vayunmathur.games.solitaire.ui.displayName import com.vayunmathur.library.ui.AlertDialog import com.vayunmathur.library.ui.Button@@ -47,11 +53,7 @@ fun GameConfigDialog(mode: GameMode, onStart: (GameConfig) -> Unit, onDismiss: (                                 SegmentedButton(shape = SegmentedButtonDefaults.itemShape(idx, 2), onClick = { drawMode = value }, selected = drawMode == value) { Text(stringResource(label)) }                             }                         }-                        SingleChoiceSegmentedButtonRow {-                            listOf(KlondikeDifficulty.RELAXED to R.string.mode_relaxed, KlondikeDifficulty.REGULAR to R.string.difficulty_regular, KlondikeDifficulty.HARD to UiR.string.hard).forEachIndexed { idx, (value, label) ->-                                SegmentedButton(shape = SegmentedButtonDefaults.itemShape(idx, 3), onClick = { klondikeDifficulty = value }, selected = klondikeDifficulty == value) { Text(stringResource(label)) }-                            }-                        }+                        KlondikePassesRow(klondikeDifficulty) { klondikeDifficulty = it }                     }                     GameMode.SPIDER -> {                         SingleChoiceSegmentedButtonRow {@@ -71,6 +73,37 @@ fun GameConfigDialog(mode: GameMode, onStart: (GameConfig) -> Unit, onDismiss: (     ) } +/**+ * Klondike passes through the stock (#911). The caption carries the meaning so each+ * segment can be just the count, which keeps four options on one row in a phone+ * dialog; the spoken label is the full phrase ("3 passes", "Unlimited passes").+ */+@OptIn(ExperimentalMaterial3Api::class)+@Composable+private fun KlondikePassesRow(selected: KlondikeDifficulty, onChange: (KlondikeDifficulty) -> Unit) {+    Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(4.dp)) {+        Text(stringResource(R.string.stock_passes), style = MaterialTheme.typography.labelLarge)+        SingleChoiceSegmentedButtonRow {+            KLONDIKE_DIFFICULTY_ORDER.forEachIndexed { idx, value ->+                val passes = value.passes()+                val spoken = if (passes == null) {+                    stringResource(R.string.passes_unlimited)+                } else {+                    pluralStringResource(R.plurals.passes_count, passes, passes)+                }+                SegmentedButton(+                    shape = SegmentedButtonDefaults.itemShape(idx, KLONDIKE_DIFFICULTY_ORDER.size),+                    onClick = { onChange(value) },+                    selected = selected == value,+                    modifier = Modifier.semantics { contentDescription = spoken },+                ) {+                    Text(passes?.toString() ?: "\u221E")+                }+            }+        }+    }+}+ @OptIn(ExperimentalMaterial3Api::class) @Composable private fun DifficultyRow(relaxed: Boolean, onChange: (Boolean) -> Unit) {
games/solitaire/src/main/res/values-et/strings.xml
diff --git a/games/solitaire/src/main/res/values-et/strings.xml b/games/solitaire/src/main/res/values-et/strings.xmlindex c191078173..d895f170bd 100644--- a/games/solitaire/src/main/res/values-et/strings.xml+++ b/games/solitaire/src/main/res/values-et/strings.xml@@ -14,7 +14,6 @@     <string name="select_mode">Vali mängutüüp</string>     <string name="mode_original">Algne</string>     <string name="mode_relaxed">Leevendatud</string>-    <string name="difficulty_regular">Tavaline</string>     <string name="auto_complete">Automaatne lõpetus</string>     <string name="completed_8">Tehtud: <xliff:g id="completed" example="2">%1$s</xliff:g>/8</string>     <string name="card_colors">Kaardivärvid</string>
games/solitaire/src/main/res/values/strings.xml
diff --git a/games/solitaire/src/main/res/values/strings.xml b/games/solitaire/src/main/res/values/strings.xmlindex 5a519117ae..3752a68d28 100644--- a/games/solitaire/src/main/res/values/strings.xml+++ b/games/solitaire/src/main/res/values/strings.xml@@ -27,10 +27,22 @@     <string name="select_mode">Select Mode</string>     <!-- MainActivity: Pyramid mode option original single pass through stock. Noun/adjective -->     <string name="mode_original">Original</string>-    <!-- MainActivity: Mode option relaxed unlimited redeals. Klondike and Pyramid. Adjective -->+    <!-- GameConfigDialog: Pyramid mode option relaxed unlimited redeals. Adjective -->     <string name="mode_relaxed">Relaxed</string>-    <!-- MainActivity: Klondike regular difficulty 2 redeals (3 passes). Adjective -->-    <string name="difficulty_regular">Regular</string>+    <!-- GameConfigDialog: Caption above the Klondike option row choosing how many times the player may go through the draw pile (stock). Noun phrase -->+    <string name="stock_passes">Passes through the stock</string>+    <!-- GameConfigDialog: Spoken label of the Klondike option allowing unlimited passes through the stock (shown as ∞); KlondikeBoard: spoken label of the empty stock in such a game. Noun phrase -->+    <string name="passes_unlimited">Unlimited passes</string>+    <!-- GameConfigDialog: Spoken label of a Klondike option allowing %1$d passes through the stock (shown as the bare number). Noun phrase -->+    <plurals name="passes_count">+        <item quantity="one"><xliff:g id="count" example="1">%1$d</xliff:g> pass</item>+        <item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> passes</item>+    </plurals>+    <!-- KlondikeBoard: Spoken label of the empty stock (shown as ↻ and the count): %1$d more passes through the stock are allowed. Noun phrase -->+    <plurals name="stock_passes_left">+        <item quantity="one"><xliff:g id="count" example="1">%1$d</xliff:g> pass left</item>+        <item quantity="other"><xliff:g id="count" example="2">%1$d</xliff:g> passes left</item>+    </plurals>      <!-- MainActivity: Button to auto-complete Klondike when all tableau faceDown empty and not won. Verb phrase CTA -->     <string name="auto_complete">Auto Complete</string>
games/solitaire/src/test/java/com/vayunmathur/games/solitaire/platform/SolitaireRulesTest.kt
diff --git a/games/solitaire/src/test/java/com/vayunmathur/games/solitaire/platform/SolitaireRulesTest.kt b/games/solitaire/src/test/java/com/vayunmathur/games/solitaire/platform/SolitaireRulesTest.ktindex 64cb7ba94f..377748de41 100644--- a/games/solitaire/src/test/java/com/vayunmathur/games/solitaire/platform/SolitaireRulesTest.kt+++ b/games/solitaire/src/test/java/com/vayunmathur/games/solitaire/platform/SolitaireRulesTest.kt@@ -6,7 +6,9 @@ import com.vayunmathur.games.solitaire.data.Card import com.vayunmathur.games.solitaire.data.DrawMode import com.vayunmathur.games.solitaire.data.GameConfig import com.vayunmathur.games.solitaire.data.GameMode+import com.vayunmathur.games.solitaire.data.KLONDIKE_DIFFICULTY_ORDER import com.vayunmathur.games.solitaire.data.KlondikeDifficulty+import com.vayunmathur.games.solitaire.data.passes import com.vayunmathur.games.solitaire.data.KlondikeState import com.vayunmathur.games.solitaire.data.PyramidState import com.vayunmathur.games.solitaire.data.Rank@@ -73,6 +75,42 @@ class SolitaireRulesTest {         assertEquals(0, KlondikeDifficulty.HARD.redeals())     } +    @Test+    fun klondikePassesPerDifficulty() {+        // Names make up the stats key and must never change; new values are appended.+        assertEquals(+            listOf("RELAXED", "REGULAR", "HARD", "TWO_PASSES"),+            KlondikeDifficulty.entries.map { it.name },+        )+        assertEquals(1, KlondikeDifficulty.TWO_PASSES.redeals())+        assertEquals(null, KlondikeDifficulty.RELAXED.passes())+        assertEquals(3, KlondikeDifficulty.REGULAR.passes())+        assertEquals(2, KlondikeDifficulty.TWO_PASSES.passes())+        assertEquals(1, KlondikeDifficulty.HARD.passes())+        assertEquals(+            listOf(KlondikeDifficulty.RELAXED, KlondikeDifficulty.REGULAR, KlondikeDifficulty.TWO_PASSES, KlondikeDifficulty.HARD),+            KLONDIKE_DIFFICULTY_ORDER,+        )+    }++    @Test+    fun twoPassKlondikeRecyclesExactlyOnce() {+        val vm = vm()+        vm.newKlondikeGame(GameConfig(drawMode = DrawMode.DRAW_ONE, klondikeDifficulty = KlondikeDifficulty.TWO_PASSES))+        assertEquals("DRAW_ONE_TWO_PASSES", vm.uiState.value.klondike!!.variant)+        assertEquals(1, vm.uiState.value.klondike!!.redealsRemaining)+        repeat(24) { vm.drawFromStock() }+        vm.drawFromStock() // recycle: second pass begins+        var k = vm.uiState.value.klondike!!+        assertEquals(24, k.stock.size)+        assertEquals(0, k.redealsRemaining)+        repeat(24) { vm.drawFromStock() }+        vm.drawFromStock() // no recycles left: nothing happens+        k = vm.uiState.value.klondike!!+        assertEquals(0, k.stock.size)+        assertEquals(24, k.waste.size)+    }+     @Test     fun tickStopsAtWin() {         assertEquals(1, KlondikeState(elapsedSeconds = 0).tick().elapsedSeconds)
games/solitaire/src/test/java/com/vayunmathur/games/solitaire/ui/KlondikeStockPassesTest.kt
diff --git a/games/solitaire/src/test/java/com/vayunmathur/games/solitaire/ui/KlondikeStockPassesTest.kt b/games/solitaire/src/test/java/com/vayunmathur/games/solitaire/ui/KlondikeStockPassesTest.ktnew file mode 100644index 0000000000..f12135766d--- /dev/null+++ b/games/solitaire/src/test/java/com/vayunmathur/games/solitaire/ui/KlondikeStockPassesTest.kt@@ -0,0 +1,90 @@+package com.vayunmathur.games.solitaire.ui++import androidx.compose.ui.test.assertIsDisplayed+import androidx.compose.ui.test.junit4.createComposeRule+import androidx.compose.ui.test.onNodeWithContentDescription+import androidx.compose.ui.test.onNodeWithText+import androidx.compose.ui.test.performClick+import com.vayunmathur.games.solitaire.data.Card+import com.vayunmathur.games.solitaire.data.GameConfig+import com.vayunmathur.games.solitaire.data.GameMode+import com.vayunmathur.games.solitaire.data.KlondikeDifficulty+import com.vayunmathur.games.solitaire.data.KlondikeState+import com.vayunmathur.games.solitaire.data.Rank+import com.vayunmathur.games.solitaire.data.Suit+import com.vayunmathur.games.solitaire.ui.dialogs.GameConfigDialog+import org.junit.Rule+import org.junit.runner.RunWith+import org.robolectric.RobolectricTestRunner+import org.robolectric.annotation.Config+import kotlin.test.Test+import kotlin.test.assertEquals+import kotlin.test.assertNull+import kotlin.test.assertTrue++/** Passes left on Klondike's empty stock slot (#911). */+@RunWith(RobolectricTestRunner::class)+@Config(sdk = [34])+class KlondikeStockPassesTest {++    @get:Rule+    val composeRule = createComposeRule()++    private val waste = listOf(Card(Suit.HEARTS, Rank.FIVE), Card(Suit.SPADES, Rank.NINE))++    @Test+    fun passesLeftFollowsRedealsAndWaste() {+        assertEquals(2, klondikePassesLeft(KlondikeState(waste = waste, redealsRemaining = 2)))+        assertEquals(1, klondikePassesLeft(KlondikeState(waste = waste, redealsRemaining = 1)))+        assertEquals(UNLIMITED_PASSES, klondikePassesLeft(KlondikeState(waste = waste, redealsRemaining = Int.MAX_VALUE)))+        // No redeals left, or nothing to recycle: the slot cannot be used.+        assertNull(klondikePassesLeft(KlondikeState(waste = waste, redealsRemaining = 0)))+        assertNull(klondikePassesLeft(KlondikeState(waste = emptyList(), redealsRemaining = 2)))+    }++    @Test+    fun stockLabelShowsRecycleGlyphAndCount() {+        assertEquals("", klondikeStockLabel(null))+        assertEquals("↻", klondikeStockLabel(UNLIMITED_PASSES))+        assertEquals("↻ 2", klondikeStockLabel(2))+        assertEquals("↻ 1", klondikeStockLabel(1))+    }++    @Test+    fun emptyStockShowsPassesLeftAndRecyclesOnTap() {+        val actions = RecordingActions()+        composeRule.setContent {+            KlondikeBoard(KlondikeState(stock = emptyList(), waste = waste, redealsRemaining = 2), actions)+        }+        composeRule.onNodeWithText("↻ 2").assertIsDisplayed()+        composeRule.onNodeWithContentDescription("2 passes left").performClick()+        assertTrue(actions.calls.contains("drawFromStock"))+    }++    @Test+    fun emptyStockInUnlimitedGameShowsBareGlyph() {+        composeRule.setContent {+            KlondikeBoard(+                KlondikeState(stock = emptyList(), waste = waste, redealsRemaining = Int.MAX_VALUE),+                RecordingActions(),+            )+        }+        composeRule.onNodeWithText("↻").assertIsDisplayed()+        composeRule.onNodeWithContentDescription("Unlimited passes").assertIsDisplayed()+    }++    @Test+    fun newGameDialogOffersEveryPassCount() {+        var started: GameConfig? = null+        composeRule.setContent {+            GameConfigDialog(mode = GameMode.KLONDIKE, onStart = { started = it }, onDismiss = {})+        }+        composeRule.onNodeWithText("Passes through the stock").assertIsDisplayed()+        composeRule.onNodeWithContentDescription("Unlimited passes").assertIsDisplayed()+        composeRule.onNodeWithContentDescription("3 passes").assertIsDisplayed()+        composeRule.onNodeWithContentDescription("1 pass").assertIsDisplayed()+        composeRule.onNodeWithContentDescription("2 passes").performClick()+        composeRule.onNodeWithText("New Game").performClick()+        assertEquals(KlondikeDifficulty.TWO_PASSES, started?.klondikeDifficulty)+    }+}