Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
633 B
2
Indexable
Never
$(document).ready(function() {
    var currentPlayer = "";
    var gameActive = false;

    // Event listener for the "X" button
    $("#btn-x").click(function() {
        if (!gameActive) {
            currentPlayer = "X";
            $("#message").text("Current Player: " + currentPlayer);
            gameActive = true;
        }
    });

    // Event listener for the "O" button
    $("#btn-o").click(function() {
        if (!gameActive) {
            currentPlayer = "O";
            $("#message").text("Current Player: " + currentPlayer);
            gameActive = true;
        }
    });

    // Rest of the game logic...
});