Basisstruktur Würfel

master
Marco Angelo Palmieri 2024-05-05 19:56:08 +02:00
commit c4c534be00
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package domain;
import java.util.Random;
/**
* Diese Klasse repräsentiert einen einzelnen Würfel.
*/
public class Würfel {
private int augenzahl;
private static final Random random = new Random();
/**
* Würfelt den Würfel und erzeugt eine neue Augenzahl zwischen 1 und 6.
*/
public void würfeln() {
augenzahl = random.nextInt(6) + 1;
}
}