Skip to content

Commit

Permalink
Better random user
Browse files Browse the repository at this point in the history
  • Loading branch information
yostane committed Aug 28, 2024
1 parent 8550793 commit 9e2e8c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions composeApp/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.navigation.compose.rememberNavController
import screens.questionScreen
import screens.scoreScreen
import screens.welcomeScreen
import kotlin.random.Random

@Composable
fun App(
Expand All @@ -30,17 +31,26 @@ fun App(
)
}
composable(route = "/quiz") {

val questions by viewModel.questionState.collectAsState()
// random manga character names
val nicknames = listOf("Naruto", "Goku", "Luffy", "Ichigo", "Saitama", "Kenshin", "Yusuke", "Gon", "Killua", "Natsu",
"Gon", "Gintoki", "Koro-sensei", "Kakashi", "Vegeta", "Sasuke", "Zoro", "Sanji", "Shanks", "Ace", "Kaido", "Katakuri",
"Law", "Deku", "Bakugo", "Todoroki", "All Might", "Asta", "Yuno", "Yami", "Julius", "Licht", "Nero", "Grimm", "Gordon",
"Yami", "Magna", "Luck", "Noelle", "Mimosa", "Vanessa", "Finral", "Charmy", "Gordon", "Grey", "Gimodelo", "Zora", "Mereoleona",
"Fuegoleon", "Leopold", "Kahono", "Kiato", "Yuno", "Yami", "Julius", "Licht", "Nero", "Grimm", "Gordon", "Yami", "Magna",
"Luck", "Noelle", "Mimosa", "Vanessa", "Finral", "Charmy", "Gordon", "Grey", "Gimodelo", "Zora", "Mereoleona", "Fuegoleon",
"Leopold", "Kahono", "Kiato", "Yuno", "Yami", "Julius", "Licht", "Nero", "Grimm", "Gordon", "Yami", "Magna", "Luck", "Noelle",
"Mimosa", "Vanessa", "Finral", "Charmy", "Gordon", "Grey", "Gimodelo", "Zora", "Mereoleona", "Fuegoleon", "Leopold", "Kahono",
"Kiato", "Yuno", "Yami", "Julius", "Licht", "Nero", "Grimm", "Gordon", "Yami", "Magna", "Luck", "Noelle", "Mimosa", "Vanessa",
"Finral", "Charmy", "Gordon", "Grey", "Gimodelo", "Zora", "Mereoleona", "Fuegoleon")

if (questions.isNotEmpty()) {
questionScreen(
questions = questions,
onFinishButtonPushed = { score: Int, questionSize: Int ->

/* FOR SPEAKER TALK DEMO ON WEB APP */ if (getPlatform().name == "WASM") viewModel.postStats(
score,
"user-${(0..1000).random()}"
"${nicknames.random()}-${Random.nextInt(1000)}"
)
navController.navigate(route = "/score/$score/$questionSize")
},
Expand Down
Binary file modified server/src/main/resources/static/composeApp.wasm
Binary file not shown.

0 comments on commit 9e2e8c3

Please sign in to comment.