Advertisement
Wouto1997

JavaLogo vierkanten

Mar 27th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import logotekenap.*;
  2.  
  3. public class MainClass extends TekenApplet {
  4.  
  5.     public int vierkanten;
  6.     public InvoerVariabele vierkantenInvoer;
  7.    
  8.     public void initialiseer() {
  9.         resize(800, 400);
  10.         vierkanten = 1;
  11.         vierkantenInvoer = new InvoerVariabele("vierkanten", 0, 64, 1);
  12.         maakZichtbaar(vierkantenInvoer);
  13.     }
  14.    
  15.     public void tekenprogramma() {
  16.         penUit();
  17.         stap(-400, -10);
  18.         penAan();
  19.         for (int j=0;j<vierkanten;j++) {
  20.             for (int i=0;i<4;i++) {
  21.                 vooruit(20);
  22.                 links(90);
  23.             }
  24.             penUit();
  25.             stap(30, 0);
  26.             penAan();
  27.         }
  28.     }
  29.    
  30.     public void invoerVarActie(InvoerVariabele iv) {
  31.         vierkanten = vierkantenInvoer.geefWaarde();
  32.         tekenOpnieuw();
  33.     }
  34.    
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement