<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Wic Wac Woe" description="Simple two-player hot-mouse Tic Tac Toe." author="Aaron Mavrinac" author_email="mavrinac@gmail.com" screenshot="http://www.mavrinac.com/files/wicwacwoe/screenshot.png" thumbnail="http://www.mavrinac.com/files/wicwacwoe/thumbnail.png" />
<Content type="html"><![CDATA[

<style>
body,td,a,p,.h{font-family:arial,sans-serif; font-size:10px; }
a:link {color:#0000cc; }
a:visited { color:#551a8b; }
a:active { color:#ff0000; }
</style>

<body onLoad="initGame()">

<br />
<div align="center">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td style="border-right: 2px solid black; border-bottom: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" name="wicwacwoe" onClick="markSpace(0)">
</td><td style="border-left: 2px solid black; border-bottom: 2px solid black; border-right: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(1)">
</td><td style="border-left: 2px solid black; border-bottom: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(2)">
</td></tr>
<tr><td style="border-top: 2px solid black; border-right: 2px solid black; border-bottom: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(3)">
</td><td style="border: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(4)">
</td><td style="border-top: 2px solid black; border-left: 2px solid black; border-bottom: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(5)">
</td></tr>
<tr><td style="border-right: 2px solid black; border-top: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(6)">
</td><td style="border-left: 2px solid black; border-top: 2px solid black; border-right: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(7)">
</td><td style="border-left: 2px solid black; border-top: 2px solid black">
<img class="wicwacwoe" src="http://www.mavrinac.com/files/wicwacwoe/spacer.gif" onClick="markSpace(8)">
</td></tr>
</table>
<p><a href="JavaScript:initGame()">New Game</a></p>
</div>

</body>

<script language="JavaScript">
/*
Wic Wac Woe 1.1.0 - JavaScript Tic Tac Toe Game
Copyright (C) 2005  Aaron Mavrinac <mavrinac@gmail.com>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

The GNU General Public License is available at the following URL:
http://www.gnu.org/licenses/gpl.txt
*/

var space;
var turn = "x";
var prev = 0;
var marked = new Array(9);

while (document.images[prev].name != "wicwacwoe")
	prev++;

function initGame()
{
	for (space=0; space < 9; space++)
	{
		turn = "x";
		marked[space] = 0;
		document.images[space+prev].src = "http://www.mavrinac.com/files/wicwacwoe/spacer.gif";
	}
}	

function markSpace(space)
{
	if (!marked[space])
	{
		marked[space] = 1;
		document.images[space+prev].src = "http://www.mavrinac.com/files/wicwacwoe/" + turn + ".gif";
		if (turn == "x")
			turn = "o";
		else
			turn = "x";
	}
}

</script>

]]></Content>
</Module>
