Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Aufgabe3 {
- public static void main(String[] args) {
- int width = 400, height = 440;
- StdDraw.setCanvasSize(width,height);
- StdDraw.setXscale(0,400);
- StdDraw.setYscale(0,440);
- int xSquare = 20, ySquare = 20;
- int xRectangle = 40, yRectangle = 40;
- for (int i = 0; i <= 11; i++) {
- for (int j = 0; j <= 10; j++) {
- if(j % 2 != 0){
- StdDraw.setPenColor(90,90,0);
- StdDraw.filledSquare(xSquare,ySquare,20);
- xSquare += 40;
- }else{
- StdDraw.setPenColor(166,166,76);
- StdDraw.filledSquare(xSquare,ySquare,20);
- xSquare += 40;
- }
- }
- if(i % 2 == 0){
- xSquare = -20;
- }else {
- xSquare = 20;
- }
- ySquare += 40;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement