example.turtlelogo.TwoTerraria.main(String[])   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
cc 1
rs 9.55
1
package example.turtlelogo;
2
3
import org.gannacademy.cdf.turtlelogo.AnimatedTurtle;
4
import org.gannacademy.cdf.turtlelogo.Terrarium;
5
import org.gannacademy.cdf.turtlelogo.Turtle;
6
7
import java.awt.*;
8
9
public class TwoTerraria {
10
  public static void main(String[] args) {
11
    Turtle red = new AnimatedTurtle();
12
    Terrarium other = new Terrarium();
13
    Turtle blue = new AnimatedTurtle(other);
14
15
    red.getTerrarium().setBackground(new Color(255, 220, 220));
16
    blue.getTerrarium().setBackground(new Color(190, 240, 255));
17
18
    red.getTerrarium().setPosition(10, 100);
19
    blue.getTerrarium().setPosition(red.getTerrarium().getWidth() + 20, 100);
20
21
    red.pc(Color.red);
22
    blue.pc(Color.blue);
23
24
    red.fd(100);
25
    blue.lt(90);
26
    blue.fd(100);
27
  }
28
}
29