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 c0f34ea commit bc30ee2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import net.opatry.game.wordle.State
import net.opatry.game.wordle.WordleRules
import net.opatry.game.wordle.allDictionaries
import net.opatry.game.wordle.loadWords
import net.opatry.game.wordle.ui.WordleViewModel
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 bc30ee2

Please sign in to comment.