Boxer
last analyzed

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 28
eloc 21

1 Method

Rating   Name   Duplication   Size   Complexity  
A example.turtlelogo.Boxer.main(String[]) 0 27 4
1
package example.turtlelogo;
2
3
import org.gannacademy.cdf.turtlelogo.Turtle;
4
import org.gannacademy.cdf.turtlelogo.docs.SavableTerrarium;
5
6
public class Boxer {
7
    public static void main(String[] args) {
8
        SavableTerrarium terrarium = new SavableTerrarium();
9
        Turtle boxer = new Turtle(terrarium);
10
11
        boxer.rt(90);
12
        boxer.fd(10);
13
        boxer.rt(90);
14
        boxer.fd(10);
15
        boxer.rt(90);
16
        boxer.fd(10);
17
        boxer.rt(90);
18
        boxer.fd(10);
19
20
        terrarium.drawTo("square.png");
21
        terrarium.clear();
22
23
        for (int row = 1; row <= 10; row++) {
24
            for (int col = 1; col <= 10; col++) {
25
                boxer.teleport(row * 20, col * 20);
0 ignored issues
show
Bug introduced by
Math operands should be cast to prevent unwanted loss of precision when mixing types. Consider casting one of the operands of this multiplication to double.
Loading history...
26
                for (int side = 0; side < 4; side++) {
27
                    boxer.rt(90);
28
                    boxer.fd(10);
29
                }
30
            }
31
        }
32
33
        terrarium.drawTo("squares.png");
34
    }
35
}
36