Guest User

tic tac toe.html

a guest
Jan 5th, 2016
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.22 KB | None | 0 0
  1. <!-- © Ted Maxwell :D hehe please guys see this funny experiment and insert a bit of AI into it :D :) -->
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.     <title>Tic Tac Toe | Pure AI</title>
  6.     <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Raleway:100|Roboto:100">
  7.     <link rel="stylesheet" type="text/css" href="tic tac toe.css">
  8.     <meta charset="UTF-8">
  9. </head>
  10. <body>
  11. <div>
  12.     <table>
  13.         <thead></thead>
  14.         <tbody><!-- All the cells are actually buttons within a table, with no default value -->
  15.             <tr>
  16.                 <td style="border-right:2px solid black"><input type="button" id="A1" value="" onclick="userClick(this.value, this.id)"></td>
  17.                 <td style="border-right:2px solid black"><input type="button" id="B1" value="" onclick="userClick(this.value, this.id)"></td>
  18.                 <td><input type="button" id="C1" value="" onclick="userClick(this.value, this.id)" ></td>
  19.             </tr>
  20.             <tr>
  21.                 <td style="border-right:2px solid black;border-top:2px solid black"><input type="button" id="A2" value="" onclick="userClick(this.value, this.id)"></td>
  22.                 <td style="border-right:2px solid black;border-top:2px solid black"><input type="button" id="B2" value="" onclick="userClick(this.value, this.id)"></td>
  23.                 <td style="border-top:2px solid black"><input type="button" id="C2" value="" onclick="userClick(this.value, this.id)"></td>
  24.             </tr>
  25.             <tr>
  26.                 <td style="border-right:2px solid black;border-top:2px solid black"><input type="button" id="A3" value="" onclick="userClick(this.value, this.id)"></td>
  27.                 <td style="border-right:2px solid black;border-top:2px solid black"><input type="button" id="B3" value="" onclick="userClick(this.value, this.id)"></td>
  28.                 <td style="border-top:2px solid black"><input type="button" id="C3" value="" onclick="userClick(this.value, this.id)"></td>
  29.             </tr>
  30.         </tbody>
  31.     </table>
  32.     <p id="winner"></p> <!-- This outputs result of game draw win lose -->
  33.     <button id="playAgain" onclick="gameRestart()"></button> <!-- Asks if u wanna play again the game -->
  34. </div>
  35. <script src="tic tac toe.js"></script>
  36. </body>
  37. </html>
  38. <!--
  39. A1|B1|C1    This is way the tic tac toe buttons are arranged like....  "A1" is id of the uppermost left cell and similarly others
  40. --|--|--   
  41. A2|B2|C2
  42. --|--|--
  43. A3|B3|C3
  44. -->
Add Comment
Please, Sign In to add comment