Created
October 5, 2025 23:57
-
-
Save WilliamLivingood/6fc2ba1ff3078eb65b9d9fdac0c43e95 to your computer and use it in GitHub Desktop.
Task 1 of L1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Turtle.*; | |
| Turtle t; | |
| void setup() { | |
| size(250, 600); | |
| background(0); | |
| stroke(255); | |
| noLoop(); | |
| t = new Turtle(this); | |
| frameRate(120); | |
| } | |
| void draw(){ | |
| // Capitol "I" and "T" | |
| t.right(90); | |
| t.penUp(); | |
| t.goToPoint(50,50); | |
| t.penDown(); | |
| t.forward(20); | |
| t.penUp(); | |
| t.forward(20); | |
| t.penDown(); | |
| t.forward(20); | |
| t.penUp(); | |
| t.goToPoint(50,70); | |
| t.penDown(); | |
| t.forward(20); | |
| t.penUp(); | |
| t.right(90); | |
| t.goToPoint(60,50); | |
| t.penDown(); | |
| t.forward(20); | |
| t.penUp(); | |
| t.goToPoint(100,50); | |
| t.penDown(); | |
| t.forward(20); | |
| t.penUp(); | |
| // Triangle | |
| t.goToPoint(50,100); | |
| t.penDown(); | |
| for (int i = 0; i < 3; i++){ | |
| t.forward(50); | |
| t.left(120); | |
| } | |
| // Regular Hexagon | |
| t.penUp(); | |
| t.goToPoint(50,200); | |
| t.penDown(); | |
| for (int i = 0; i < 5; i++){ | |
| t.forward(50); | |
| t.left(72); | |
| } | |
| // Circle | |
| int radius = 50; | |
| int reps = 360; | |
| int angle = 360 / reps; | |
| float length = 2 * PI * radius / reps; | |
| t.penUp(); | |
| t.goToPoint(50,400); | |
| t.penDown(); | |
| for (int i = 0; i < reps; i++){ | |
| t.forward(length); | |
| t.left(angle); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment