-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblema10.java
More file actions
50 lines (40 loc) · 1.17 KB
/
Copy pathProblema10.java
File metadata and controls
50 lines (40 loc) · 1.17 KB
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
44
45
46
47
48
49
50
import acm.graphics.GArc;
import acm.program.GraphicsProgram;
import java.awt.*;
public class Problema10 extends GraphicsProgram {
public void run() {
GArc ga = new GArc(0, 140,140, 140, 45, 270);
ga.setFillColor(Color.YELLOW);
ga.setFilled(true);
ga.setColor(Color.ORANGE);
add(ga);
int i = 0;
while(i < getWidth()-140){
ga.setLocation(i, 80);
pause(350);
if(ga.getStartAngle() == 0){
ga.setStartAngle(45);
ga.setSweepAngle(270);
}else{
ga.setStartAngle(0);
ga.setSweepAngle(360);
}
i+=70;
}
while(i >= 0){
ga.setLocation(i, 80);
pause(350);
if(ga.getStartAngle() == -180){
ga.setStartAngle(-135);
ga.setSweepAngle(270);
}else{
ga.setStartAngle(-180);
ga.setSweepAngle(360);
}
i-=70;
}
}
public static void main(String[] args) {
new Problema10().start(args);
}
}