wordmaker: detect if hint completes word
- Commit
89a9c20b1ccc976024a31b687a495c909643888c- Author
- Vayun Mathur <[email protected]>
- When
- 2026-06-12 18:23 UTC (5 months ago)
- Parents
f08be81
Diff
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/util/WordMakerViewModel.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/util/WordMakerViewModel.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/util/WordMakerViewModel.ktindex e024147d17..b82b253620 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/util/WordMakerViewModel.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/util/WordMakerViewModel.kt@@ -123,6 +123,15 @@ class WordMakerViewModel(application: Application) : AndroidViewModel(applicatio val target = unrevealed.random() _hintCooldownEnd.value = System.currentTimeMillis() + 30_000L- viewModelScope.launch { levelDataStore.addRevealedHint(target.first, target.second) }+ viewModelScope.launch {+ levelDataStore.addRevealedHint(target.first, target.second)++ val nowRevealed = revealedPositions + target+ crosswordData.letterPositions.forEach { (word, positions) ->+ if (word !in foundWords && nowRevealed.containsAll(positions)) {+ levelDataStore.addFoundWord(word)+ }+ }+ } } }