Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion demo/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ void rect(Turtle& t, float width, float height) {
t.right(90);
}


void meetTurtle() {
Turtle t;
t.satinon(0.3);
Expand Down
Binary file added demo/demo.dst
Binary file not shown.
13 changes: 13 additions & 0 deletions src/turtle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,19 @@ void Turtle::tree(int level) {
}
}

void polygon(Turtle& t, float size, int sides) {

if (sides < 3){
std::cout << "Polygon must be at least 3 sides";
} else{
for (int x = 0; x < sides; ++x){
t.forward(size);
float degree = 360.0 / sides;
t.left(degree);
}
}
}

void Turtle::svtree(float trunklength, int levels, float trunkwidth) {
if (trunklength < 1 || levels <= 0) return;
bool satin_was_on = satin_is_on_;
Expand Down