Advertisement
Guest User

Untitled

a guest
May 26th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1.     private static void printAllTowers(int maxRect, int rectCount, int rectLen, int drawX){
  2.         // TODO: Implementieren Sie hier Ihre Lösung für die Angabe
  3.         if(maxRect * 2 == rectCount)
  4.             return;
  5.         StdDraw.setPenColor(rectCount % 2 == 0?COLOR_BLACK:COLOR_GREEN);
  6.         int drawCount = rectCount < maxRect ? rectCount : (maxRect * 2) - rectCount;
  7.         printOneTower( drawCount ,rectLen,drawX,0);
  8.         printAllTowers(maxRect,rectCount+1,rectLen ,drawX + rectLen);
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement