Turtlegraphics with Java
HomeAufgabenDruckenJava-Online

Serie 5: Selektion (if-else, switch)

Draw the following figures. Change the colours using the if-else structure.

1)
2)


3)


4)


5)
Use the switch structure to draw the figure below with 10 different colours. The fill(x, y) method fills the closed area in which the point (x, y) is located. With getX() and getY() you can query the current position of the turtle after each square and move the point slightly so that it lies in the closed area.