From 281cb218b38fe5c831024e26b7a4054ff881f485 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Mon, 5 Feb 2024 18:48:34 -0800 Subject: [PATCH] Count iterations when done --- uckf.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/uckf.go b/uckf.go index b63a786..c1fb792 100644 --- a/uckf.go +++ b/uckf.go @@ -9,7 +9,7 @@ import ( "math/rand" ) -var edgeSize = flag.Int("n", 8, "Cells per side") +var edgeSize = flag.Int("n", 15, "Cells per side") type scanState int const ( @@ -39,20 +39,18 @@ func main() { evals = append(evals, make([]fuckness, *edgeSize)) } - dump(board, evals, "Starting position") - iterations := uint64(0) - scream := uint64(1) + scream := uint64(0) for(isStillFucked(board, evals)) { if iterations >= scream { - dump(board, evals, fmt.Sprint("Iteration", iterations)) + dump(board, evals, fmt.Sprint("Iteration ", iterations)) scream = iterations << 1 } iterations++ 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 {