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() {
|
go func() {
|
||||||
sort.SliceStable(entries, func(i, j int) bool {
|
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() {
|
mainthread.Wait(func() {
|
||||||
comparisons++
|
comparisons++
|
||||||
|
|
||||||
@ -108,6 +116,9 @@ func main() {
|
|||||||
ui.b2.SetText(formatButtonText(entries[j]))
|
ui.b2.SetText(formatButtonText(entries[j]))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if shuf {
|
||||||
|
return !<-ret
|
||||||
|
}
|
||||||
return <-ret
|
return <-ret
|
||||||
})
|
})
|
||||||
active = false
|
active = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user