step 5 time changes
This commit is contained in:
parent
2f6796f57f
commit
0cbae7b15a
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
static const char *TAG = "step5";
|
static const char *TAG = "step5";
|
||||||
|
|
||||||
|
static const int TIMES_TO_SOLVE = 9;
|
||||||
|
|
||||||
static std::random_device rd;
|
static std::random_device rd;
|
||||||
static std::mt19937 gen(rd());
|
static std::mt19937 gen(rd());
|
||||||
static std::uniform_int_distribution<> puzzle_dist(0, 7);
|
static std::uniform_int_distribution<> puzzle_dist(0, 7);
|
||||||
@ -59,7 +61,7 @@ void step5(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int INDICATOR_RED[6] = {20, 0, 0, 10, 10, 5};
|
const int INDICATOR_RED[6] = {20, 0, 0, 10, 10, 5};
|
||||||
const int INDICATOR_GREEN[6] = {0, 0, 10, 5, 0, 5};
|
const int INDICATOR_GREEN[6] = {0, 0, 10, 5, 0, 7};
|
||||||
const int INDICATOR_BLUE[6] = {0, 10, 0, 0, 5, 5};
|
const int INDICATOR_BLUE[6] = {0, 10, 0, 0, 5, 5};
|
||||||
static std::uniform_int_distribution<> led_number_dist(0, 21);
|
static std::uniform_int_distribution<> led_number_dist(0, 21);
|
||||||
|
|
||||||
@ -78,7 +80,7 @@ void step5(void) {
|
|||||||
|
|
||||||
clean_bomb();
|
clean_bomb();
|
||||||
int solved_puzzles = 0;
|
int solved_puzzles = 0;
|
||||||
while (solved_puzzles < 3) {
|
while (solved_puzzles < ) {
|
||||||
lcd_set_cursor(&lcd, 1, 1);
|
lcd_set_cursor(&lcd, 1, 1);
|
||||||
|
|
||||||
int puzzle = puzzle_dist(gen);
|
int puzzle = puzzle_dist(gen);
|
||||||
@ -88,7 +90,7 @@ void step5(void) {
|
|||||||
switch (puzzle) {
|
switch (puzzle) {
|
||||||
case 0: {
|
case 0: {
|
||||||
lcd_print(&lcd, "Clear");
|
lcd_print(&lcd, "Clear");
|
||||||
set_module_time(15000);
|
set_module_time(30000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
std::vector<int> indicator_options = all_leds;
|
std::vector<int> indicator_options = all_leds;
|
||||||
@ -131,7 +133,7 @@ void step5(void) {
|
|||||||
}
|
}
|
||||||
case 1: {
|
case 1: {
|
||||||
lcd_print(&lcd, "Blank");
|
lcd_print(&lcd, "Blank");
|
||||||
set_module_time(30000);
|
set_module_time(40000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
std::uniform_int_distribution<> on_indicators_dist(16, 21);
|
std::uniform_int_distribution<> on_indicators_dist(16, 21);
|
||||||
@ -139,7 +141,7 @@ void step5(void) {
|
|||||||
|
|
||||||
std::vector<int> indicator_options = all_leds;
|
std::vector<int> indicator_options = all_leds;
|
||||||
const int INDICATOR_RED[6] = {20, 0, 0, 10, 10, 5};
|
const int INDICATOR_RED[6] = {20, 0, 0, 10, 10, 5};
|
||||||
const int INDICATOR_GREEN[6] = {0, 0, 10, 5, 0, 5};
|
const int INDICATOR_GREEN[6] = {0, 0, 10, 5, 0, 7};
|
||||||
const int INDICATOR_BLUE[6] = {0, 10, 0, 0, 5, 5};
|
const int INDICATOR_BLUE[6] = {0, 10, 0, 0, 5, 5};
|
||||||
|
|
||||||
set_unique_leds_random_color(indicator_options, indicators_num, INDICATOR_RED, INDICATOR_BLUE, INDICATOR_GREEN);
|
set_unique_leds_random_color(indicator_options, indicators_num, INDICATOR_RED, INDICATOR_BLUE, INDICATOR_GREEN);
|
||||||
@ -190,7 +192,7 @@ void step5(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
set_module_time(30000);
|
set_module_time(25000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
std::uniform_int_distribution<> lit_led_dist(0, 1);
|
std::uniform_int_distribution<> lit_led_dist(0, 1);
|
||||||
@ -316,7 +318,7 @@ void step5(void) {
|
|||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
lcd_print(&lcd, "Nothing");
|
lcd_print(&lcd, "Nothing");
|
||||||
set_module_time(20000);
|
set_module_time(25000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
const int COLOR_RED[5] = {0, 20, 10, 0, 0};
|
const int COLOR_RED[5] = {0, 20, 10, 0, 0};
|
||||||
@ -378,7 +380,7 @@ void step5(void) {
|
|||||||
}
|
}
|
||||||
case 4: {
|
case 4: {
|
||||||
lcd_print(&lcd, "Blink");
|
lcd_print(&lcd, "Blink");
|
||||||
set_module_time(30000);
|
set_module_time(35000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
@ -525,13 +527,13 @@ void step5(void) {
|
|||||||
}
|
}
|
||||||
case 5: {
|
case 5: {
|
||||||
lcd_print(&lcd, "Ummm");
|
lcd_print(&lcd, "Ummm");
|
||||||
set_module_time(30000);
|
set_module_time(35000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
std::uniform_int_distribution<> indicator_number_dist(0, 5);
|
std::uniform_int_distribution<> indicator_number_dist(0, 5);
|
||||||
|
|
||||||
const int INDICATOR_RED[4] = {0, 20, 10, 10};
|
const int INDICATOR_RED[4] = {0, 20, 10, 0};
|
||||||
const int INDICATOR_GREEN[4] = {10, 0, 5, 5};
|
const int INDICATOR_GREEN[4] = {10, 0, 5, 0};
|
||||||
const int INDICATOR_BLUE[4] = {0, 0, 0, 10};
|
const int INDICATOR_BLUE[4] = {0, 0, 0, 10};
|
||||||
|
|
||||||
// green, red, yellow, blue
|
// green, red, yellow, blue
|
||||||
@ -602,7 +604,7 @@ void step5(void) {
|
|||||||
|
|
||||||
// red, purple, blue, white, green, yellow
|
// red, purple, blue, white, green, yellow
|
||||||
const uint8_t COLORS_RED[6] = {20, 10, 0, 5, 0, 10};
|
const uint8_t COLORS_RED[6] = {20, 10, 0, 5, 0, 10};
|
||||||
const uint8_t COLORS_GREEN[6] = {0, 0, 0, 5, 10, 5};
|
const uint8_t COLORS_GREEN[6] = {0, 0, 0, 7, 10, 5};
|
||||||
const uint8_t COLORS_BLUE[6] = {0, 10, 10, 5, 0, 0};
|
const uint8_t COLORS_BLUE[6] = {0, 10, 10, 5, 0, 0};
|
||||||
|
|
||||||
int button_colors[4];
|
int button_colors[4];
|
||||||
@ -698,7 +700,7 @@ void step5(void) {
|
|||||||
}
|
}
|
||||||
case 7: {
|
case 7: {
|
||||||
lcd_print(&lcd, "What");
|
lcd_print(&lcd, "What");
|
||||||
set_module_time(40000);
|
set_module_time(50000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
std::uniform_int_distribution<> math_number_dist(1, 9);
|
std::uniform_int_distribution<> math_number_dist(1, 9);
|
||||||
@ -853,7 +855,7 @@ void step5(void) {
|
|||||||
}
|
}
|
||||||
case 8: {
|
case 8: {
|
||||||
lcd_print(&lcd, "Plink");
|
lcd_print(&lcd, "Plink");
|
||||||
set_module_time(15000);
|
set_module_time(40000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
std::uniform_int_distribution<> indicator_number_dist(0, 4);
|
std::uniform_int_distribution<> indicator_number_dist(0, 4);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user