0% found this document useful (0 votes)
42 views4 pages

Code Project

The document contains the code for a program that draws a reindeer shape using different colors and movements. It uses loops and conditionals to: 1) Draw the reindeer's body by moving forward and filling squares 7 times in brown. 2) Draw the head by moving and filling squares 3 times, then moving down. 3) Continue drawing the rest of the reindeer shape over 11 lines using different colors, movements forward/backward, and filling squares in various patterns.

Uploaded by

api-475757701
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views4 pages

Code Project

The document contains the code for a program that draws a reindeer shape using different colors and movements. It uses loops and conditionals to: 1) Draw the reindeer's body by moving forward and filling squares 7 times in brown. 2) Draw the head by moving and filling squares 3 times, then moving down. 3) Continue drawing the rest of the reindeer shape over 11 lines using different colors, movements forward/backward, and filling squares in various patterns.

Uploaded by

api-475757701
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

public class Reindeer {

public static void main(String[] args) {

//line 1 (also all comments)

for (int i; i <=7 ; i++) {


moveForward();
}
changeColor(brown);
for (int i; i <=3 ; i++) {
fillSquare();
moveForward();
moveForward();
}
fillSquare();
moveDown();

//line 2

moveBackward();
fillSquare();
for (int i; i <=3 ; i++) {
moveBackward();
}
for (int i; i <=3 ; i++) {
fillSquare();
moveBackward();
}
moveDown();

//line 3

moveForward();
fillSquare();
for (int i; i <=4 ; i++) {
moveForward();
}
for (int i; i <=2 ; i++) {
fillSquare();
moveForward();
}
moveDown();
//line 4

for (int i; i <=2 ; i++) {


moveBackward();
}
fillSquare();
for (int i; i <=4 ; i++) {
moveBackward();
}
fillSquare();
for (int i; i <=2 ; i++) {
moveBackward();
}
moveDown();

//line 5

changeColor(beige);
for (int i; i<=8; i++) {
fillSquare();
moveForward();
}
moveDown();

//line 6
moveBackward();
for (int i; i<=8; i++) {
fillSquare();
moveBackward();
}
moveDown();

//line 7
for (int i; i<=2; i++) {
fillSquare();
moveForward();
}
changeColor(black);
moveForward();
fillSquare();
changeColor(white);
moveForward();
fillSquare();
changeColor(beige);
for (int i; i<=5; i++) {
moveForward();
fillSquare();
}
moveDown();

//line 8
for (int i; i<=5; i++) {
fillSquare();
moveBackward();
}
changeColor(white);
fillSquare();
moveBackward();
changeColor(black);
fillSquare();
moveBackward();
fillSquare();
changeColor(beige);
moveBackward();
fillSquare();
moveBackward();
fillSquare();
changeColor(red);
moveBackward();
fillSquare();
moveBackward();
moveDown();

//line 9
for (int i; i<=2; i++) {
fillSquare();
moveForward();
}
changeColor(beige);
for (int i; i<=2; i++) {
fillSquare();
moveForward();
}
moveForward();
moveForward();
for (int i; i<=6; i++) {
fillSquare();
moveForward();
}
moveDown();

//line 10
moveBackward();
moveBackward();
for (int i; i<=8; i++) {
fillSquare();
moveBackward();
}
moveDown();

//line 11
for (int i; i<=3; i++) {
moveForward();
}
for (int i; i<=4; i++) {
fillSquare();
moveForward();
}

} ​//end main

}​ //end class

You might also like