Count iterations when done
This commit is contained in:
parent
5bbf188285
commit
281cb218b3
8
uckf.go
8
uckf.go
@ -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,10 +39,8 @@ 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))
|
||||||
@ -52,7 +50,7 @@ func main() {
|
|||||||
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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user