shuffle each entry comparison
This commit is contained in:
parent
ba1e7964ab
commit
70b3f97368
11
main.go
11
main.go
@ -98,6 +98,14 @@ func main() {
|
||||
go func() {
|
||||
sort.SliceStable(entries, func(i, j int) bool {
|
||||
|
||||
// Towards the end, sort.SliceStable has the pattern of putting one
|
||||
// entry in the top button all the time
|
||||
// Maybe shuffle them
|
||||
shuf := (rand.Int()%2 == 0)
|
||||
if shuf {
|
||||
i, j = j, i
|
||||
}
|
||||
|
||||
mainthread.Wait(func() {
|
||||
comparisons++
|
||||
|
||||
@ -108,6 +116,9 @@ func main() {
|
||||
ui.b2.SetText(formatButtonText(entries[j]))
|
||||
})
|
||||
|
||||
if shuf {
|
||||
return !<-ret
|
||||
}
|
||||
return <-ret
|
||||
})
|
||||
active = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user