Skip to content

Commit

Permalink
[Mosaic] Clean Mosaic main app and use full dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
opatry committed Jan 3, 2024
1 parent 43634b7 commit e9db1b3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ import kotlinx.coroutines.withContext
import net.opatry.game.wordle.State
import net.opatry.game.wordle.WordleRules
import net.opatry.game.wordle.ui.WordleViewModel
import net.opatry.game.wordle.allDictionaries
import net.opatry.game.wordle.loadWords
import org.jline.terminal.TerminalBuilder

suspend fun main() = runMosaic {
// TODO check terminal is compatible (eg. IDEA is not!)
val words = allDictionaries
.find { it.language == "en" && it.wordSize == 5 }
?.loadWords()
?: error("Can't find default dictionary")
var playing = true
val viewModel = WordleViewModel(WordleRules(listOf("Hello", "Great", "Tiles", "Tales")))
val viewModel = WordleViewModel(WordleRules(words))

setContent {
GameScreen(viewModel)
Expand Down

0 comments on commit e9db1b3

Please sign in to comment.