From 7e036417ae4df61484734522fd28aaeb9c637de3 Mon Sep 17 00:00:00 2001 From: drake Date: Sun, 11 Aug 2024 20:40:38 -0500 Subject: [PATCH] step 3 end cycle early --- main/steps/step3.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/main/steps/step3.cpp b/main/steps/step3.cpp index 8139765..7baca08 100644 --- a/main/steps/step3.cpp +++ b/main/steps/step3.cpp @@ -603,14 +603,18 @@ void step3(void) { } } - // bool success = false; - // for (int i = 0; i < sizeof(buttons_cycling); i++) { - // if ((buttons_cycling[i] == true) || (button_turned_on == false && led_off != -1)) { - // strike("Ran out of time!"); - // success = false; - // break; - // } - // } + bool success = true; + for (int i = 0; i < sizeof(buttons_cycling); i++) { + if ((buttons_cycling[i] == true) || (button_turned_on == false && led_off != -1)) { + success = false; + break; + } + } + if (success) { + solved_puzzles++; + solved_correctly = true; + break; + } } if ((xTaskGetTickCount() - lastCycleTime) >= pdMS_TO_TICKS(500)) { ESP_LOGI(TAG, "Cycling LEDs");