Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
33
Task/Dragon-curve/Processing/dragon-curve.processing
Normal file
33
Task/Dragon-curve/Processing/dragon-curve.processing
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
float l = 3;
|
||||
int ints = 13;
|
||||
|
||||
void setup() {
|
||||
size(700, 600);
|
||||
background(0, 0, 255);
|
||||
translate(150, 100);
|
||||
stroke(255);
|
||||
turn_left(l, ints);
|
||||
turn_right(l, ints);
|
||||
}
|
||||
|
||||
void turn_right(float l, int ints) {
|
||||
if (ints == 0) {
|
||||
line(0, 0, 0, -l);
|
||||
translate(0, -l);
|
||||
} else {
|
||||
turn_left(l, ints-1);
|
||||
rotate(radians(90));
|
||||
turn_right(l, ints-1);
|
||||
}
|
||||
}
|
||||
|
||||
void turn_left(float l, int ints) {
|
||||
if (ints == 0) {
|
||||
line(0, 0, 0, -l);
|
||||
translate(0, -l);
|
||||
} else {
|
||||
turn_left(l, ints-1);
|
||||
rotate(radians(-90));
|
||||
turn_right(l, ints-1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue