improve examples
This commit is contained in:
parent
ece26bfe04
commit
59d6bc164e
@ -20,7 +20,7 @@ fn koch(depth: u32, turtle: &mut TurtlePlan, distance: f32) {
|
|||||||
#[turtle_main("Koch Snowflake")]
|
#[turtle_main("Koch Snowflake")]
|
||||||
fn draw(turtle: &mut TurtlePlan) {
|
fn draw(turtle: &mut TurtlePlan) {
|
||||||
// Position turtle
|
// Position turtle
|
||||||
turtle.set_speed(1001);
|
turtle.set_speed(5000);
|
||||||
turtle.pen_up();
|
turtle.pen_up();
|
||||||
turtle.backward(150.0);
|
turtle.backward(150.0);
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ fn draw(turtle: &mut TurtlePlan) {
|
|||||||
|
|
||||||
// Draw Koch snowflake (triangle of Koch curves)
|
// Draw Koch snowflake (triangle of Koch curves)
|
||||||
for _ in 0..3 {
|
for _ in 0..3 {
|
||||||
koch(4, turtle, 300.0);
|
koch(6, turtle, 300.0);
|
||||||
turtle.right(120.0);
|
turtle.right(120.0);
|
||||||
turtle.set_speed(1200);
|
turtle.set_speed(1200);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,5 +23,6 @@ fn draw(turtle: &mut TurtlePlan) {
|
|||||||
.left(90.0)
|
.left(90.0)
|
||||||
.pen_down()
|
.pen_down()
|
||||||
.circle_right(8.0, 360.0, 12)
|
.circle_right(8.0, 360.0, 12)
|
||||||
.end_fill();
|
.end_fill()
|
||||||
|
.hide();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user