소스 검색

Still not there

Piotr Czajkowski 2 년 전
부모
커밋
dc3ac09d74
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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)