Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- © Ted Maxwell :D hehe please guys see this funny experiment and insert a bit of AI into it :D :) -->
- <!DOCTYPE html>
- <html>
- <head>
- <title>Tic Tac Toe | Pure AI</title>
- <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Raleway:100|Roboto:100">
- <link rel="stylesheet" type="text/css" href="tic tac toe.css">
- <meta charset="UTF-8">
- </head>
- <body>
- <div>
- <table>
- <thead></thead>
- <tbody><!-- All the cells are actually buttons within a table, with no default value -->
- <tr>
- <td style="border-right:2px solid black"><input type="button" id="A1" value="" onclick="userClick(this.value, this.id)"></td>
- <td style="border-right:2px solid black"><input type="button" id="B1" value="" onclick="userClick(this.value, this.id)"></td>
- <td><input type="button" id="C1" value="" onclick="userClick(this.value, this.id)" ></td>
- </tr>
- <tr>
- <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>
- <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>
- <td style="border-top:2px solid black"><input type="button" id="C2" value="" onclick="userClick(this.value, this.id)"></td>
- </tr>
- <tr>
- <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>
- <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>
- <td style="border-top:2px solid black"><input type="button" id="C3" value="" onclick="userClick(this.value, this.id)"></td>
- </tr>
- </tbody>
- </table>
- <p id="winner"></p> <!-- This outputs result of game draw win lose -->
- <button id="playAgain" onclick="gameRestart()"></button> <!-- Asks if u wanna play again the game -->
- </div>
- <script src="tic tac toe.js"></script>
- </body>
- </html>
- <!--
- 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
- --|--|--
- A2|B2|C2
- --|--|--
- A3|B3|C3
- -->
Add Comment
Please, Sign In to add comment