Как создать головоломку 15 на JQ
<!DOCTYPE html>
<html>
<!--
Homework 6: Fifteen Puzzle
You should not modify fifteen.html. Your JS code should work with an
unmodified version of this file.
-->
<head>
<title>Fifteen Puzzle</title>
<link href="fifteen.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script>
<!-- I had to add the line above for some reason. I couldn't get it to work for a very very long time and someone pointed me to
this line of code above and it fixed all of my issues. -->
<script src="fifteen.js" type="text/javascript"></script>
</head>
<body>
<h1>Fifteen Puzzle</h1>
<p>
The goal of the fifteen puzzle is to un-jumble its fifteen squares
by repeatedly making moves that slide squares into the empty space.
How quickly can you solve it?
</p>
<div id="puzzlearea">
<!-- the following are the actual fifteen puzzle pieces -->
<div>1</div> <div>2</div> <div>3</div> <div>4</div>
<div>5</div> <div>6</div> <div>7</div> <div>8</div>
<div>9</div> <div>10</div> <div>11</div> <div>12</div>
<div>13</div> <div>14</div> <div>15</div>
</div>
<p id="controls">
<button id="shufflebutton">Shuffle</button>
</p>
<p>
American puzzle author and mathematician Sam Loyd is often falsely
credited with creating the puzzle; indeed, Loyd claimed from 1891
until his death in 1911 that he invented it.
The puzzle was actually created around 1874 by Noyes Palmer Chapman,
a postmaster in Canastota, New York.
</p>
<div id="w3c">
<a href="https://webster.cs.washington.edu/validate.php">
<img src="w3c-html.png" alt="Validate HTML5" width="88" height="31"/></a>
<a href="https://webster.cs.washington.edu/validate-css.php">
<img src="w3c-css.png" alt="Validate CSS" width="88" height="31"/></a>
</div>
</body>
</html>
Lonely Lynx