Skip to content

Commit 833833a

Browse files
committed
properly support puzzles with no outputs
1 parent c34b318 commit 833833a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sim.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,8 @@ static void check_completion(struct solution *solution, struct board *board)
14691469
min = count;
14701470
}
14711471
board->complete = min >= solution->target_number_of_outputs;
1472+
if (min == UINT64_MAX)
1473+
return;
14721474
if (min > board->output_cycles_capacity) {
14731475
board->output_cycles_capacity = (min * 3) / 2;
14741476
if (board->output_cycles_capacity < 6)

steady-state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ struct steady_state run_until_steady_state(struct solution *solution, struct boa
257257
uint64_t repetition_period_length = board->cycle - snapshot.cycle;
258258
struct steady_state result = {
259259
.number_of_cycles = board->cycle - snapshot.cycle,
260-
.number_of_outputs = UINT64_MAX,
260+
.number_of_outputs = solution->number_of_inputs_and_outputs ? UINT64_MAX : 0,
261261
.outputs_repeat_after_cycle = board->cycle,
262262
.eventual_behavior = EVENTUALLY_ENTERS_STEADY_STATE,
263263
};

0 commit comments

Comments
 (0)