forked from an/flokati
questions.go: make quiz questions file a parameter
This commit is contained in:
parent
eb82de80e8
commit
327cb50aab
|
@ -4,6 +4,7 @@ package modules
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
|
@ -20,6 +21,7 @@ type quizQuestion struct {
|
|||
}
|
||||
|
||||
var (
|
||||
quizQuestionsFile = flag.String("quiz_questions_file", "questions.txt", "quiz: questions file")
|
||||
quizCtrlCh = make(chan string, 1024)
|
||||
quizAnswerCh = make(chan *Message, 1024)
|
||||
quizQuestions []quizQuestion
|
||||
|
@ -67,7 +69,7 @@ func quiz() {
|
|||
}
|
||||
|
||||
func quizRun() {
|
||||
quizQuestions = quizLoadQuestions("questions.txt")
|
||||
quizQuestions = quizLoadQuestions(*quizQuestionsFile)
|
||||
ranklist := make(map[string]int)
|
||||
SayCh <- fmt.Sprintf("%s\nQuiz gestartet.", "*")
|
||||
for {
|
||||
|
|
Loading…
Reference in New Issue