From 2f4ed5caeb960f8e2ffd331ad2b7057e534f374d Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Tue, 25 Oct 2011 21:12:26 -0700 Subject: [PATCH] Some safety against future modifications in DimensionSizes(). --- planeteer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/planeteer.go b/planeteer.go index 5acf98f..314a3b6 100644 --- a/planeteer.go +++ b/planeteer.go @@ -142,6 +142,13 @@ func DimensionSizes(data planet_data) []int { dims[NeedFighters] = bint(*drones > 0) + 1 dims[NeedShields] = bint(*batteries > 0) + 1 dims[Visit] = 1 << uint(len(visit())) + + // Remind myself to add a line above when adding new dimensions + for i, dim := range dims { + if dim < 1 { + panic(i) + } + } return dims } -- 2.44.1