[mastermind]

mastermind.php

PHP
<?php
/**
 * Plugin Name: Reversi Othello Game
 * Plugin URI: https://it-breeze.info/
 * Description: Mastermind game 
 * Version: 2.0.3
 * Author: Mike Vahldieck
 * Author URI: https://it-breeze.info/
 * License: GPL v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html

mastermind.js

JAVASCRIPT
document.addEventListener("DOMContentLoaded", function () {
    const colors = ["R", "G", "B", "Y", "O", "P"];
    let firstPegClickCount = 0; // To track clicks on the first peg

    // Allow pegs to cycle through colors
    document.querySelectorAll(".peg").forEach((peg, index) => {
        peg.addEventListener("click", function () {
            let currentColor = this.getAttribute("data-color");
            if (!currentColor) currentColor = ""; // Handle empty data-color

mastermind.css

CSS
/* General Styling */
#mastermind-game {
    font-family: Arial, sans-serif;
    max-width: 500px;
    margin: 30px auto;
    padding: 20px;
    border-radius: 12px;
    background: #d2a679;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: #333;