Skip to content

Instantly share code, notes, and snippets.

@ReginFell
Created July 22, 2019 06:24
Show Gist options
  • Save ReginFell/2e64c6131eb3375c9b9124bdc4ebfbe0 to your computer and use it in GitHub Desktop.
Save ReginFell/2e64c6131eb3375c9b9124bdc4ebfbe0 to your computer and use it in GitHub Desktop.
private fun handleFailedAttempt() {
attempts++
saveFailedAttemptsData()
if (attempts >= 5) {
if (!timerRunning) {
startTimer()
}
when {
attempts == 5 -> resetTime(ATTEMPT_FIVE_TIME)
attempts == 6 -> resetTime(ATTEMPT_SIX_TIME)
attempts == 7 -> resetTime(ATTEMPT_SEVEN_TIME)
attempts >= 8 -> resetTime(ATTEMPT_EIGHT_TIME)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment