use the builder syntax for yinyang
This commit is contained in:
parent
73d0ef4881
commit
78ecc84493
@ -4,24 +4,24 @@ use turtle_lib::*;
|
|||||||
|
|
||||||
#[turtle_main("Yin-Yang")]
|
#[turtle_main("Yin-Yang")]
|
||||||
fn draw(turtle: &mut TurtlePlan) {
|
fn draw(turtle: &mut TurtlePlan) {
|
||||||
turtle.set_speed(100);
|
turtle
|
||||||
|
.set_speed(100)
|
||||||
turtle.circle_left(90.0, 180.0, 36);
|
.circle_left(90.0, 180.0, 36)
|
||||||
turtle.begin_fill();
|
.begin_fill()
|
||||||
turtle.circle_left(90.0, 180.0, 36);
|
.circle_left(90.0, 180.0, 36)
|
||||||
turtle.circle_left(45.0, 180.0, 26);
|
.circle_left(45.0, 180.0, 26)
|
||||||
turtle.circle_right(45.0, 180.0, 26);
|
.circle_right(45.0, 180.0, 26)
|
||||||
turtle.pen_up();
|
.pen_up()
|
||||||
turtle.right(90.0);
|
.right(90.0)
|
||||||
turtle.forward(37.0);
|
.forward(37.0)
|
||||||
turtle.left(90.0);
|
.left(90.0)
|
||||||
turtle.pen_down();
|
.pen_down()
|
||||||
turtle.circle_right(8.0, 360.0, 12);
|
.circle_right(8.0, 360.0, 12)
|
||||||
turtle.pen_up();
|
.pen_up()
|
||||||
turtle.right(90.0);
|
.right(90.0)
|
||||||
turtle.forward(90.0);
|
.forward(90.0)
|
||||||
turtle.left(90.0);
|
.left(90.0)
|
||||||
turtle.pen_down();
|
.pen_down()
|
||||||
turtle.circle_right(8.0, 360.0, 12);
|
.circle_right(8.0, 360.0, 12)
|
||||||
turtle.end_fill();
|
.end_fill();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user