// 11_RandomExample.java - יצירת מספרים אקראיים

import java.util.Random;

public class RandomExample {
    public static void main(String[] args) {
        Random rand = new Random();

        // מספר שלם אקראי בין 0 ל-99
        int n1 = rand.nextInt(100);
        System.out.println("מספר 0..99: " + n1);

        // מספר שלם בין 1 ל-100 (כולל)
        int n2 = rand.nextInt(100) + 1;
        System.out.println("מספר 1..100: " + n2);

        // מספר בטווח כללי [min, max]
        int min = 50;
        int max = 150;
        int n3 = rand.nextInt(max - min + 1) + min;
        System.out.println("מספר " + min + ".." + max + ": " + n3);

        // מספר עשרוני אקראי
        double d = rand.nextDouble();
        System.out.println("מספר עשרוני 0..1: " + d);

        // ערך בוליאני אקראי
        boolean b = rand.nextBoolean();
        System.out.println("בוליאני אקראי: " + b);

        // הטלת קובייה 10 פעמים
        System.out.println("\nהטלות קובייה:");
        for (int i = 0; i < 10; i++) {
            int roll = rand.nextInt(6) + 1;
            System.out.println("הטלה " + (i + 1) + ": " + roll);
        }

        // Math.random - חלופה פשוטה
        System.out.println("\nMath.random: " + Math.random());
        int dice = (int)(Math.random() * 6) + 1;
        System.out.println("קובייה עם Math: " + dice);
    }
}
