Count iterations when done

This commit is contained in:
Kistaro Windrider 2024-02-05 18:48:34 -08:00
parent 5bbf188285
commit 281cb218b3
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

10
uckf.go
View File

@ -9,7 +9,7 @@ import (
"math/rand" "math/rand"
) )
var edgeSize = flag.Int("n", 8, "Cells per side") var edgeSize = flag.Int("n", 15, "Cells per side")
type scanState int type scanState int
const ( const (
@ -39,20 +39,18 @@ func main() {
evals = append(evals, make([]fuckness, *edgeSize)) evals = append(evals, make([]fuckness, *edgeSize))
} }
dump(board, evals, "Starting position")
iterations := uint64(0) iterations := uint64(0)
scream := uint64(1) scream := uint64(0)
for(isStillFucked(board, evals)) { for(isStillFucked(board, evals)) {
if iterations >= scream { if iterations >= scream {
dump(board, evals, fmt.Sprint("Iteration", iterations)) dump(board, evals, fmt.Sprint("Iteration ", iterations))
scream = iterations << 1 scream = iterations << 1
} }
iterations++ iterations++
fuckUp(board, evals) fuckUp(board, evals)
} }
dump(board, evals, "Not a single fuck") dump(board, evals, fmt.Sprintf("Not a single fuck (%d iterations)", iterations))
} }
func onBoard(i, j int) bool { func onBoard(i, j int) bool {