Added some status-update output to surreal number breeding program. Given the
authorAaron Taylor <ataylor@subgeniuskitty.com>
Tue, 11 May 2021 19:49:50 +0000 (12:49 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Tue, 11 May 2021 19:49:50 +0000 (12:49 -0700)
long runtimes, it's useful to see how far the program has progressed.

chapter-1-experiments/ch1-breeding-numbers.go

index 9e9e637..fd1901f 100644 (file)
@@ -221,11 +221,17 @@ func main() {
     // Seed it by hand with the number zero as generation-0.
     var universe surrealUniverse
     universe.nextUniqueID = 0
     // Seed it by hand with the number zero as generation-0.
     var universe surrealUniverse
     universe.nextUniqueID = 0
+    fmt.Println("Seeding generation 0 by hand.")
     universe.insert(surrealNumber{surrealSet{}, surrealSet{}, 0, 0})
 
     // Breed however many generations of numbers were requested by the user and
     // add them all to the universe.
     universe.insert(surrealNumber{surrealSet{}, surrealSet{}, 0, 0})
 
     // Breed however many generations of numbers were requested by the user and
     // add them all to the universe.
+    fmt.Printf("Breeding Generation:")
     for generation := 1; generation <= remainingGenerations; generation++ {
     for generation := 1; generation <= remainingGenerations; generation++ {
+        if generation != 1 {
+            fmt.Printf(",")
+        }
+        fmt.Printf(" %d", generation)
         // First generate all possible reduced form symbols per Axiom 1.
         potentialNumbers := permuteExistingNumbers(generation, universe)
         // Now prune out any symbols which are NOT valid numbers per Axiom 2.
         // First generate all possible reduced form symbols per Axiom 1.
         potentialNumbers := permuteExistingNumbers(generation, universe)
         // Now prune out any symbols which are NOT valid numbers per Axiom 2.
@@ -234,6 +240,7 @@ func main() {
         // be weeded out in the attempt.
         addNumbersToUniverse(validNumbers, &universe)
     }
         // be weeded out in the attempt.
         addNumbersToUniverse(validNumbers, &universe)
     }
+    fmt.Printf(".\n")
 
     // Print the number line with generation on the horizontal axis and
     // magnitude on the vertical axis.
 
     // Print the number line with generation on the horizontal axis and
     // magnitude on the vertical axis.