From b3fd6106abf7f0c142ac4975599d6d8cf1aff1d8 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 21 Jun 2012 00:01:48 -0700 Subject: [PATCH] Print total cost of fighters and shields --- planeteer.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/planeteer.go b/planeteer.go index 3f5951f..a8e6516 100644 --- a/planeteer.go +++ b/planeteer.go @@ -711,6 +711,25 @@ func main() { fmt.Println(description[i]) } + // Calculate total cost of fighters and shields + if *drones > 0 || *batteries > 0 { + fmt.Println() + } + if *drones > 0 { + final_state[BuyFighters] = 0 + alt_best := FindBestState(data, dims, table, final_state) + cost := table[alt_best].value - table[best].value + fmt.Println("Drones were", float64(cost)/float64(*drones), "each") + final_state[BuyFighters] = 1 + } + if *batteries > 0 { + final_state[BuyShields] = 0 + alt_best := FindBestState(data, dims, table, final_state) + cost := table[alt_best].value - table[best].value + fmt.Println("Batteries were", float64(cost)/float64(*batteries), "each") + final_state[BuyShields] = 1 + } + // Use extra eden warps if *end_edens > 0 { fmt.Println() -- 2.44.1