Game of 15 (HTML/CSS Portion)

<head> <style type="text/css"> #wrapper { width: 150px; margin: 0px auto; } table { border-collapse: collapse; margin: 0 auto; } table tr td { border: 1px solid black; width: 20px; height: 20px; text-align: center; font-family: monospace; } #output { text-align: center; } .hide { display: none; } </style> </head> <body> <div id="wrapper"> <table> <tr> <td id="box0" onclick="checkBoard(0,0);"></td> <td id="box1" onclick="checkBoard(0,1);"></td> <td id="box2" onclick="checkBoard(0,2);"></td> <td id="box3" onclick="checkBoard(0,3);"></td> </tr> <tr> <td id="box4" onclick="checkBoard(1,0);"></td> <td id="box5" onclick="checkBoard(1,1);"></td> <td id="box6" onclick="checkBoard(1,2);"></td> <td id="box7" onclick="checkBoard(1,3);"></td> </tr> <tr> <td id="box8" onclick="checkBoard(2,0);"></td> <td id="box9" onclick="checkBoard(2,1);"></td> <td id="box10" onclick="checkBoard(2,2);"></td> <td id="box11" onclick="checkBoard(2,3);"></td> </tr> <tr> <td id="box12" onclick="checkBoard(3,0);"></td> <td id="box13" onclick="checkBoard(3,1);"></td> <td id="box14" onclick="checkBoard(3,2);"></td> <td id="box15" onclick="checkBoard(3,3);"></td> </tr> </table> <div id="output"> <button id="scramble" onclick="scrambleAll();">Scramble</button> <br /> <pre id="debugg"></pre> </div> </div> </body>
Get the Javascript to go along with it here: http://codepad.co/s/42f3ad

See a working example here: http://codepen.io/pen/monstersaurous/gameof15/9

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.