绘制图像!
This commit is contained in:
@@ -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() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user