Posts

Showing posts with the label DeepSeek

Simple Pair game Array function

 <!DOCTYPE html> <html> <head>     <title>Button Matching Game</title>     <style>         button {             padding: 15px 30px;             font-size: 20px;             margin: 10px;         }         #message {             font-size: 24px;             margin: 20px;             color: green;         }     </style> </head> <body>     <h1>Button Matching Game</h1>     <div id="buttons">         <button id="A">A</button>         <button id="Apple">🍎</button>         <button id="B">B</button>     ...

Button matching A apple B ball add score 1

  <!DOCTYPE html> <html> <body> <button id="btnA">A</button> <button id="btnApple">🍎</button> <button id="btnB">B</button> <button id="btnBall">🏀</button> <p>Matches: <span id="score">0</span></p> <p id="message">Match A-🍎 and B-🏀!</p> <script> // Game setup var score = 0; var activeButton = null; var buttons = {   "btnA": { pair: "btnApple", pressed: false },   "btnApple": { pair: "btnA", pressed: false },   "btnB": { pair: "btnBall", pressed: false },   "btnBall": { pair: "btnB", pressed: false } }; // AS2-style button setup for(var id in buttons) {   var btn = document.getElementById(id);   btn.onPress = function() {     if(!buttons[this.id].pressed) {       // First button clicked       if(!activeButton) {         activeButton = this....

When button id match

 <!DOCTYPE html> <html> <head>   <title>Match Button Pairs Game</title>   <style>     .btn {       padding: 10px 20px;       margin: 5px;       font-size: 16px;       transition: all 0.3s;     }     .hidden {       visibility: hidden; /* Makes button invisible but keeps its space */     }     .selected {       background-color: yellow;     }   </style> </head> <body> <h2>Match Score: <span id="score">0</span></h2> <button class="btn" id="btn1" onclick="handleClick('btn1')">Button 1</button> <button class="btn" id="btn1" onclick="handleClick('btn1')">Button 1</button> <button class="btn" id="btn2" onclick="handleClick('btn2')">Button 2</button> <button class="btn" id="btn2" onclick="handleClick('btn2')"...