-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathshow_two_turtle.cpp
More file actions
43 lines (33 loc) · 846 Bytes
/
Copy pathshow_two_turtle.cpp
File metadata and controls
43 lines (33 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* File: show_two_turtle.cpp
* Author: Jesse W. Walker
*/
#include "CTurtle.hpp"
namespace ct = cturtle;
int main(int argc, char** argv) {
ct::TurtleScreen scr;
scr.bgcolor({"black"});
ct::Turtle brad(scr);
ct::Turtle angie(scr);
brad.pencolor({"yellow"});
brad.speed(ct::TS_FASTEST);
for(int i = 0; i < 36; i++){
for(int j = 0; j < 4; j++){
brad.forward(200);
brad.right(90);
}
brad.right(10);
}
angie.pencolor({"blue"});
angie.speed(ct::TS_FASTEST);
int size = 1;
for(int i = 0; i < 300; i++){
angie.forward(size);
angie.right(91);
size += 1;
}
brad.hideturtle();
angie.hideturtle();
scr.exitonclick();
return 0;
}