Skip to content
Snippets Groups Projects
Commit a79a269d authored by mh16842's avatar mh16842
Browse files

added Pasch

parent 92577f3a
No related branches found
No related tags found
No related merge requests found
package pasch;
import java.util.Random;
public class Pasch {
public static void main(String[] args) {
int wuerfel1;
int wuerfel2;
int wuerfel3;
int anzahlWuerfe = 0;
while (true) {
wuerfel1 = new Random().nextInt(6) + 1;
wuerfel2 = new Random().nextInt(6) + 1;
wuerfel3 = new Random().nextInt(6) + 1;
anzahlWuerfe++;
System.out.println("Wurf, " + anzahlWuerfe + " Gewuerfelt, " + wuerfel1 + ", " + wuerfel2 + ", " + wuerfel3);
if (wuerfel1 == wuerfel2 && wuerfel1 == wuerfel3) {
break;
}
}
System.out.println("Pasch!");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment