<!--
--  Uploaded on : https://haxor.my.id/open/apple.html
--  Official Web : https://prinsh.com
--  script-deface-generator.prinsh.com
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Apple Fortune Game</title>
    <style>
        body {
            background-color: #f4f4f4;
            font-family: Arial, sans-serif;
            text-align: center;
            padding: 20px;
        }
        h1 {
            color: #333;
        }
        .apple {
            display: inline-block;
            margin: 15px;
            padding: 20px;
            background-color: #ffcc66;
            border-radius: 10px;
            cursor: pointer;
            transition: transform 0.2s;
        }
        .apple:hover {
            transform: scale(1.05);
        }
        .result {
            margin-top: 20px;
            font-size: 1.5em;
            color: #007bff;
        }
    </style>
</head>
<body>
    <h1>Apple Fortune Game</h1>
    <div class="apple" id="apple1" onclick="chooseApple(1)">Apple 1</div>
    <div class="apple" id="apple2" onclick="chooseApple(2)">Apple 2</div>
    <div class="apple" id="apple3" onclick="chooseApple(3)">Apple 3</div>
    <div class="result" id="result"></div>

    <script>
        function chooseApple(appleNumber) {
            // Generate a random value for each apple
            const appleValues = {
                1: Math.floor(Math.random() * 100) + 1,
                2: Math.floor(Math.random() * 100) + 1,
                3: Math.floor(Math.random() * 100) + 1
            };

            // Show the selected apple's value
            const selectedValue = appleValues[appleNumber];
            document.getElementById('result').textContent = `You selected Apple ${appleNumber} with a value of ${selectedValue}`;

            // Logic to determine the best apple based on generated values
            const bestApple = Object.keys(appleValues).reduce((a, b) => appleValues[a] > appleValues[b] ? a : b);
            const bestValue = appleValues[bestApple];

            // Show the best apple
            if (appleNumber == bestApple) {
                document.getElementById('result').textContent += `\nYou chose the best apple! Value: ${bestValue}`;
            } else {
                document.getElementById('result').textContent += `\nApple ${bestApple} is better! Value: ${bestValue}`;
            }
        }
    </script>
</body>
</html>