From 75c2906080caf9209ed7523417e2d6dd68928e3b Mon Sep 17 00:00:00 2001 From: unlockable Date: Thu, 24 Aug 2023 18:18:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=98=E5=88=B6=E5=9B=BE=E5=83=8F=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 8By8/8By8.ino | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/8By8/8By8.ino b/8By8/8By8.ino index 5bc0133..4b40e9c 100644 --- a/8By8/8By8.ino +++ b/8By8/8By8.ino @@ -77,36 +77,14 @@ void setup() { Serial.begin(115200); - randomSeed(analogRead(0)); -} - -bool create_new = false; - -void loop() { - for (int z = 0; z < 7; z++) { - for (int x = 0; x < 8; x++) { - for (int y = 0; y < 8; y++) { - int upper_state = Cube::get_status(x, y, z + 1); - if (upper_state > 0) { - Cube::set_status(x, y, z, upper_state); - Cube::set_status(x, y, z + 1, upper_state - 1); - } else { - Cube::set_status(x, y, z, 0); - } - } + for (int x = 0; x < 8; x++) { + for (int y = 0; y < 8; y++) { + Cube::set_status(x, y, (x + y)/2, 3); } } +} - if (create_new) { - int num = random(64); - Cube::set_status(num / 8, num % 8, 7, 3); - create_new = false; - } - else { - create_new = true; - } - // num = random(64); - // Cube::set_status(num / 8, num % 8, 7, 3); - // delay(5); +void loop() { + } \ No newline at end of file