Browse Source

Still not there

Piotr Czajkowski 1 year ago
parent
commit
dc3ac09d74
1 changed files with 2 additions and 2 deletions
  1. 2 2
      19/code.go

+ 2 - 2
19/code.go

@@ -198,12 +198,12 @@ func checkPlan(plan blueprint) int {
 				newRobots.obsidian++
 				resources = produceObsidian(plan, resources)
 			}
-		} else if canProduceClay(plan, resources) {
+		} else if robots.clay < plan.obsidianCost[1] && canProduceClay(plan, resources) {
 			if shouldProduceClay(plan, robots, resources) {
 				newRobots.clay++
 				resources = produceClay(plan, resources)
 			}
-		} else if canProduceOre(plan, resources) {
+		} else if robots.ore < plan.clayCost && canProduceOre(plan, resources) {
 			if shouldProduceClay(plan, robots, resources) {
 				newRobots.ore++
 				resources = produceOre(plan, resources)