Dragon curve: Difference between revisions

Content deleted Content added
Noel (talk | contribs)
Line 4,002:
=={{header|POV-Ray}}==
Example code recursive and iterative can be found at [http://aesculier.fr/fichiersPovray/dragon/dragon.html Courbe du Dragon].
 
=={{header|Processing}}==
<lang Prolog>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);
}
}</lang>'''The sketch can be run on line''' :<BR> [https://www.openprocessing.org/sketch/847651 here.]
 
 
 
 
=={{header|Prolog}}==