]> git.scottworley.com Git - planeteer/commitdiff
Cost of --end
authorScott Worley <sworley@chkno.net>
Fri, 22 Jun 2012 04:51:42 +0000 (21:51 -0700)
committerScott Worley <sworley@chkno.net>
Fri, 22 Jun 2012 04:51:42 +0000 (21:51 -0700)
planeteer.go

index a6272f807ba9a2d26a05f5352ff3bd07f8304213..a3fb84ca76005256dc003559eeb4b33823ac9ac8 100644 (file)
@@ -734,7 +734,7 @@ func main() {
                final_state[BuyShields] = 1
        }
 
                final_state[BuyShields] = 1
        }
 
-       // Use extra eden warps
+       // Use extra eden warps / cost of --end_edends
        if *end_edens > 0 {
                fmt.Println()
        }
        if *end_edens > 0 {
                fmt.Println()
        }
@@ -761,4 +761,15 @@ func main() {
        }
        final_state[Visit] = dims[Visit] - 1
 
        }
        final_state[Visit] = dims[Visit] - 1
 
+       // Cost of --end
+       if len(end()) > 0 {
+               save_end_string := *end_string
+               *end_string = ""
+               end_cache = nil
+               alt_best := FindBestState(data, dims, table, final_state)
+               cost := table[alt_best].value - table[best].value
+               fmt.Printf("\r\n%11v Cost of --end %v\n", Commas(cost), save_end_string)
+               *end_string = save_end_string
+       }
+
 }
 }