"); FullWindow.document.write("
| ");
for (var i=0; i<16; i++)
{
FullWindow.document.write(" ") } } FullWindow.document.write(" |
")
FullWindow.document.close()
}
function random_heat(vertical)
{
var heat=Math.floor((4)*Math.random());
if (vertical)
{
var chosen=blankspot%4+heat*4;
}
else
{
var chosen=heat+blankspot-blankspot%4;
};
if (chosen != blankspot)
{
return chosen;
}
else
{
return random_heat(vertical);
}
}
function scramble()
{
var vertical=true;
inscramble=true;
for (var q=0; q<16; q++)
{
chosen=random_heat(vertical);
check(chosen);
if (vertical)
{
vertical=false;
}
else
{
vertical=true;
}
}
setInterval("DoTimer()",1000);
inscramble=false;
started=true;
}
function check(n)
{
var direction=0;
var distance=0;
if (Math.floor(n/4)==Math.floor(blankspot/4) & n!=blankspot)
{
direction=(n-blankspot)/Math.abs((n-blankspot));
distance=Math.abs(blankspot-n);
}
else
{
if (n%4==blankspot%4 & n!=blankspot)
{
direction=4*(n-blankspot)/Math.abs((n-blankspot));
distance=Math.abs(blankspot-n)/4;
}
}
block_move(blankspot, direction, distance);
if (!(inscramble)) {CheckWin()}
}
function block_move(start, direction, distance)
{
for (var m=1; m<=distance; m++)
{
move(start+direction*m,blankspot);
}
}
function move(from,to)
{
document.images["i"+to].src=document.images["i"+from].src;
document.images["i"+from].src=PuzzleImages[15].src;
blankspot=from;
}
function draw_board()
{
for (var i=0; i<16; i++)
{
document.write("
");
if ((i+1)%4 == 0)
{
document.write("
");
}
}
}
// -->
Taoism was very important in the Chinese Empire. The symbol of yin-yang, the two opposites, is an integral part of Taoism. This slide puzzle contains a picture of the yin-yang symbol, broken up into 16 pieces. One of the pieces is blank. Click on any adjacent square, and it will be moved into the blank space. You can also move entire rows or columns, try it! When you're ready to play for time, click the Play button. The puzzle will be scrambled and the timer will start. To see what the final picture should look like, click the Preview button.
|
|
|