forked from an/flokati
fixed ranklist bug
This commit is contained in:
parent
acd39ed0af
commit
58fe1dbc4d
|
@ -102,20 +102,21 @@ func quizPrintRanklist(ranklist map[string]int) {
|
||||||
if len(ranklist) == 0 {
|
if len(ranklist) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ranklistTmp = copy(ranklist)
|
||||||
SayCh <- fmt.Sprintf("%s\nAktueller Punktestand:", "*")
|
SayCh <- fmt.Sprintf("%s\nAktueller Punktestand:", "*")
|
||||||
for {
|
for {
|
||||||
maxk := ""
|
maxk := ""
|
||||||
maxv := -1
|
maxv := -1
|
||||||
if len(ranklist) == 0 {
|
if len(ranklistTmp) == 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
for k, v := range ranklist {
|
for k, v := range ranklistTmp {
|
||||||
if v > maxv {
|
if v > maxv {
|
||||||
maxv = v
|
maxv = v
|
||||||
maxk = k
|
maxk = k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete(ranklist, maxk)
|
delete(ranklistTmp, maxk)
|
||||||
SayCh <- fmt.Sprintf("%s\n%s: %d", "*", maxk, maxv)
|
SayCh <- fmt.Sprintf("%s\n%s: %d", "*", maxk, maxv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue