daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int nWuerfe = 20;
  2. int wuerfel1[] = new int [nWuerfe];
  3. int wuerfel2[] = new int [nWuerfe];
  4. int augen1;
  5. int augen2;
  6. int zaehler = 0;
  7.  
  8. void setup() {
  9.   wuerfelMasch();
  10.   println("W1 " + wuerfel1[0]);
  11.   println("W2 " + wuerfel2[0]);
  12.   println("W1 " + wuerfel1[1]);
  13.   println("W2 " + wuerfel2[1]);
  14.   println("W1 " + wuerfel1[2]);
  15.   println("W2 " + wuerfel2[2]);
  16.   println("W1 " + wuerfel1[3]);
  17.   println("W2 " + wuerfel2[3]);
  18.   println("W1 " + wuerfel1[4]);
  19.   println("W2 " + wuerfel2[4]);
  20.   println("W1 " + wuerfel1[5]);
  21.   println("W2 " + wuerfel2[5]);
  22.   println("Zaehler " + zaehler);
  23. }
  24.  
  25. void draw() {
  26.    
  27. }
  28.  
  29. void wuerfelMasch() {
  30.   for (int i = 0; i <= nWuerfe-1; i++) {
  31.     augen1 = (int)random(1, 6);
  32.     augen2 = (int)random(1, 6);
  33.     wuerfel1[i] = augen1;
  34.     wuerfel2[i] = augen2;
  35.     if (wuerfel1[i] == wuerfel2[i]) {
  36.       zaehler++;
  37.     }
  38.   }
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top