From 44f64960b787903319f44e4c17c9696dea904d40 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Sat, 21 Jan 2017 17:04:24 +0100 Subject: [PATCH] modules/quiz: Changed hint timing --- modules/quiz.go | 9 ++++++++- modules/sc.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/quiz.go b/modules/quiz.go index a49d6cc..79cfdc2 100644 --- a/modules/quiz.go +++ b/modules/quiz.go @@ -122,6 +122,13 @@ func quizWaitForAnswer(q quizQuestion) (bool, bool, string, int) { i := 0 haveAnswer := false timer := time.Now().Unix() + timeHintCh := make(chan bool) + go func(chan bool) { + for i := 0; i < 4; i++ { + time.Sleep(15 * time.Second) + timeHintCh <- true + } + }(timeHintCh) for { select { case m := <-quizAnswerCh: @@ -150,7 +157,7 @@ func quizWaitForAnswer(q quizQuestion) (bool, bool, string, int) { return false, false, "", 0 } break - case <-time.After(15 * time.Second): + case <-timeHintCh: i++ if i > 3 { if haveAnswer { diff --git a/modules/sc.go b/modules/sc.go index 4952943..cf506af 100644 --- a/modules/sc.go +++ b/modules/sc.go @@ -38,7 +38,7 @@ const ( RE_ORG_COMM = `
  • (.*)
  • ` FANS_INT = 1000 FLEET_INT = 1000 - FUNDS_INT = 10000 + FUNDS_INT = 50000 ) var (