func flight_plan() []string {
if flight_plan_cache == nil {
if *flight_plan_string == "" {
func flight_plan() []string {
if flight_plan_cache == nil {
if *flight_plan_string == "" {
/* Use relative prices rather than absolute prices because you
can get relative prices without traveling to each planet. */
RelativePrices map[string]int
/* Use relative prices rather than absolute prices because you
can get relative prices without traveling to each planet. */
RelativePrices map[string]int
- Edens = iota // 1 3 # of Eden warp units (0 - 2 typically)
- Cloaks // 2 1-2 # of Devices of Cloaking (0 or 1)
- UnusedCargo // 3 4 # of unused cargo spaces (0 - 3 typically)
- Fuel // 4 17 Hyper jump power left (0 - 16)
- Location // 5 26 Location (which planet)
- Hold // 6 15 Cargo bay contents (a *Commodity or nil)
- Traded // 7 2 Traded yet?
- BuyFighters // 8 1-2 Errand: Buy fighter drones
- BuyShields // 9 1-2 Errand: Buy shield batteries
- Visit // 10 1-2**N Visit: Stop by these N planets in the route
+ Edens = iota // 1 3 # of Eden warp units (0 - 2 typically)
+ Cloaks // 2 1-2 # of Devices of Cloaking (0 or 1)
+ UnusedCargo // 3 4 # of unused cargo spaces (0 - 3 typically)
+ Fuel // 4 17 Hyper jump power left (0 - 16)
+ Location // 5 26 Location (which planet)
+ Hold // 6 15 Cargo bay contents (a *Commodity or nil)
+ Traded // 7 2 Traded yet?
+ BuyFighters // 8 1-2 Errand: Buy fighter drones
+ BuyShields // 9 1-2 Errand: Buy shield batteries
+ Visit // 10 1-2**N Visit: Stop by these N planets in the route
func CellValue(data planet_data, dims []int, table []State, addr []int) int32 {
my_index := EncodeIndex(dims, addr)
if table[my_index].value == CELL_BEING_EVALUATED {
func CellValue(data planet_data, dims []int, table []State, addr []int) int32 {
my_index := EncodeIndex(dims, addr)
if table[my_index].value == CELL_BEING_EVALUATED {
_, available := data.Planets[data.i2p[addr[Location]]].RelativePrices["Eden Warp Units"]
if !available {
other[Edens] = addr[Edens] + 1
_, available := data.Planets[data.i2p[addr[Location]]].RelativePrices["Eden Warp Units"]
if !available {
other[Edens] = addr[Edens] + 1
- Consider(data, dims, table, other, -absolute_price * *drones, &best_value, best_source)
+ Consider(data, dims, table, other, -absolute_price**drones, &best_value, best_source)
- Consider(data, dims, table, other, -absolute_price * *batteries, &best_value, best_source)
+ Consider(data, dims, table, other, -absolute_price**batteries, &best_value, best_source)
other[Visit] = addr[Visit] & ^(1 << i)
Consider(data, dims, table, other, 0, &best_value, best_source)
}
other[Visit] = addr[Visit] & ^(1 << i)
Consider(data, dims, table, other, 0, &best_value, best_source)
}
- Consider(data, dims, table, other, -absolute_price * quantity, &best_value, best_source)
+ Consider(data, dims, table, other, -absolute_price*quantity, &best_value, best_source)
to := data.i2p[addr[Location]]
line += fmt.Sprintf("Jump from %v to %v (%v hyper jump units)", from, to, prev[Fuel]-addr[Fuel])
}
to := data.i2p[addr[Location]]
line += fmt.Sprintf("Jump from %v to %v (%v hyper jump units)", from, to, prev[Fuel]-addr[Fuel])
}
from := data.i2p[prev[Location]]
to := data.i2p[addr[Location]]
line += fmt.Sprintf("Eden warp from %v to %v", from, to)
from := data.i2p[prev[Location]]
to := data.i2p[addr[Location]]
line += fmt.Sprintf("Eden warp from %v to %v", from, to)
}
if addr[BuyShields] == 1 && prev[BuyShields] == 0 {
line += fmt.Sprint("Buy ", *batteries, " Shield Batterys")
}
if addr[BuyShields] == 1 && prev[BuyShields] == 0 {
line += fmt.Sprint("Buy ", *batteries, " Shield Batterys")