shuffle each entry comparison

This commit is contained in:
mappu 2025-05-04 13:49:13 +12:00
parent ba1e7964ab
commit 70b3f97368

11
main.go
View File

@ -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