Skip to content

Bellamarie420/Slot-machine-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Slot-machine-

Slot Machine

<title>Slot Machine</title>

Slot Machine

Press the button to spin the slot machine!

<button onclick="spin()">Spin</button>

<p id="result"></p>

<script>
    function spin() {
        var symbols = ["Cherry", "Orange", "Lemon", "Apple", "Banana"];
        var result = [];
        
        for (var i = 0; i < 3; i++) {
            var randomIndex = Math.floor(Math.random() * symbols.length);
            result.push(symbols[randomIndex]);
        }
        
        document.getElementById("result").innerHTML = "Result: " + result.join(" - ");
    }
</script>

About

Slot Machine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published