I started out doing it like this:
Code: Select all
<img src="picture.gif" onClick="myFunction()">
Code: Select all
<a href="#" onClick="myFunction()"><img src="picture.gif" border="0"></a>
Code: Select all
<img src="picture.gif" onClick="myFunction()">
Code: Select all
<a href="#" onClick="myFunction()"><img src="picture.gif" border="0"></a>
function NewBoard()
{
for(i=0;i<9;i++)
{
board = -1 // Set all squares to unowned.
document.images.src = "empty.gif" // Replace any X's and O's with
// a blank space.
}
turn = 0 // Player 0 (X) can now move.
moves = 0 // We've had 0 moves taken so far. (imagine that!)
}
Check the onkeydown handler of the BODY element, it all starts there.But how do you rotate the pieces?