new file: Files/flashplayer_32_sa.exe new file: favicon.ico new file: globe.gif new file: imgs/download.png new file: imgs/zuck.jpg new file: index.html new file: other.ico new file: script.js new file: site.webmanifest new file: sitemap.html new file: styles/backround.css new file: styles/border.css new file: styles/fonts/Titillium_Web/OFL.txt new file: styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf new file: styles/fonts/webfontkit-20221027-163353/generator_config.txt new file: styles/fonts/webfontkit-20221027-163353/specimen_files/grid_12-825-55-15.css new file: styles/fonts/webfontkit-20221027-163353/specimen_files/specimen_stylesheet.css new file: styles/fonts/webfontkit-20221027-163353/stylesheet.css new file: styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-demo.html new file: styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff new file: styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff2 new file: styles/fonts/webfontkit-20221027-165950/generator_config.txt new file: styles/fonts/webfontkit-20221027-165950/specimen_files/grid_12-825-55-15.css new file: styles/fonts/webfontkit-20221027-165950/specimen_files/specimen_stylesheet.css new file: styles/fonts/webfontkit-20221027-165950/stylesheet.css new file: styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-demo.html new file: styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff new file: styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff2 new file: styles/style.css new file: tools/2048/.gitignore new file: tools/2048/.jshintrc new file: tools/2048/CONTRIBUTING.md new file: tools/2048/LICENSE.txt new file: tools/2048/README.md new file: tools/2048/Rakefile new file: tools/2048/favicon.ico new file: tools/2048/index.html new file: tools/2048/js/animframe_polyfill.js new file: tools/2048/js/application.js new file: tools/2048/js/bind_polyfill.js new file: tools/2048/js/classlist_polyfill.js new file: tools/2048/js/game_manager.js new file: tools/2048/js/grid.js new file: tools/2048/js/html_actuator.js new file: tools/2048/js/keyboard_input_manager.js new file: tools/2048/js/local_storage_manager.js new file: tools/2048/js/tile.js new file: tools/2048/meta/apple-touch-icon.png new file: tools/webretro/cores/neocd_libretro.js new file: tools/webretro/cores/neocd_libretro.wasm new file: tools/webretro/cores/nestopia_libretro.js new file: tools/webretro/cores/nestopia_libretro.wasm new file: tools/webretro/cores/o2em_libretro.js new file: tools/webretro/cores/o2em_libretro.wasm new file: tools/webretro/cores/opera_libretro.js new file: tools/webretro/cores/opera_libretro.wasm
394 lines
12 KiB
HTML
394 lines
12 KiB
HTML
<!doctype html>
|
|
<html lang="en"><!-- #BeginTemplate "/Templates/Main.dwt" --><!-- DW6 -->
|
|
|
|
<!-- Mirrored from www.mathsisfun.com/games/tic-tac-toe-old.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 01:06:43 GMT -->
|
|
<head>
|
|
<!-- #BeginEditable "doctitle" -->
|
|
<title>Tic-Tac-Toe</title>
|
|
<!-- #EndEditable -->
|
|
<meta name="keywords" content="math, maths, mathematics, school, homework, education">
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
|
<meta name="HandheldFriendly" content="true">
|
|
<meta http-equiv="pics-label" content='(PICS-1.1 "http://www.classify.org/safesurf/" L gen true for "http://www.mathsisfun.com" r (SS~~000 1))'>
|
|
<meta name="referrer" content="always">
|
|
<link rel="stylesheet" type="text/css" href="../style3.css" />
|
|
<script src="../main3.js" type="text/javascript"></script>
|
|
</head>
|
|
|
|
<body id="bodybg">
|
|
<div class="bg">
|
|
<div id="stt"></div>
|
|
<div id="hdr"></div>
|
|
<div id="logo"><a href="../index.html"><img src="../images/style/logo.svg" alt="Math is Fun" /></a></div>
|
|
<div id="gtran"><script type="text/javascript">document.write(getTrans());</script></div>
|
|
<div id="gplus"><script type="text/javascript">document.write(getGPlus());</script></div>
|
|
<div id="adTopOuter" class="centerfull noprint">
|
|
<div id="adTop">
|
|
<script type="text/javascript">document.write(getAdTop());</script>
|
|
</div>
|
|
</div>
|
|
<div id="adHide">
|
|
<div id="showAds1"><a href="javascript:showAds()">Show Ads</a></div>
|
|
<div id="hideAds1"><a href="javascript:hideAds()">Hide Ads</a><br>
|
|
<a href="../about-ads.html">About Ads</a></div>
|
|
</div>
|
|
<div id="menuWide" class="menu">
|
|
<script type="text/javascript">document.write(getMenu(0));</script>
|
|
</div>
|
|
<div id="linkto">
|
|
<div id="linktort"><script type="text/javascript">document.write(getLinks());</script></div>
|
|
</div>
|
|
<div id="search" role="search"><script type="text/javascript">document.write(getSearch());</script></div>
|
|
<div id="menuSlim" class="menu">
|
|
<script type="text/javascript">document.write(getMenu(1));</script>
|
|
</div>
|
|
<div id="menuTiny" class="menu">
|
|
<script type="text/javascript">document.write(getMenu(2));</script>
|
|
</div>
|
|
<div id="extra"></div>
|
|
</div>
|
|
<div id="content" role="main"><!-- #BeginEditable "Body" -->
|
|
|
|
<h1 align="center">Tic-Tac-Toe</h1>
|
|
<table width="90%" border="0" align="center">
|
|
<tr>
|
|
<td>Play the classic Tic-Tac-Toe game against the computer. <b>You play as the X's and the computer is the O's. </b> The first player to get three squares in a row wins. </td>
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
<script language="JavaScript" type="text/javascript">
|
|
<!-- Original: Maximilian Stocker (maxstocker@reallyusefulcomputing.com) -->
|
|
|
|
<!-- This script and many more are available free online at -->
|
|
<!-- The JavaScript Source!! http://javascript.internet.com -->
|
|
|
|
<!-- Begin
|
|
var x = "images/ttt-x.jpg";
|
|
var o = "images/ttt-o.jpg";
|
|
var blank = "images/ttt-blank.jpg";
|
|
|
|
var pause = 0;
|
|
var all = 0;
|
|
var a = 0;
|
|
var b = 0;
|
|
var c = 0;
|
|
var d = 0;
|
|
var e = 0;
|
|
var f = 0;
|
|
var g = 0;
|
|
var h = 0;
|
|
var i = 0;
|
|
var temp="";
|
|
var ok = 0;
|
|
var cf = 0;
|
|
var choice=9;
|
|
var aRandomNumber = 0;
|
|
var comp = 0;
|
|
var t = 0;
|
|
var wn = 0;
|
|
var ls = 0;
|
|
var ts = 0;
|
|
|
|
function logicOne() {
|
|
if ((a==1)&&(b==1)&&(c==1)) all=1;
|
|
if ((a==1)&&(d==1)&&(g==1)) all=1;
|
|
if ((a==1)&&(e==1)&&(i==1)) all=1;
|
|
if ((b==1)&&(e==1)&&(h==1)) all=1;
|
|
if ((d==1)&&(e==1)&&(f==1)) all=1;
|
|
if ((g==1)&&(h==1)&&(i==1)) all=1;
|
|
if ((c==1)&&(f==1)&&(i==1)) all=1;
|
|
if ((g==1)&&(e==1)&&(c==1)) all=1;
|
|
if ((a==2)&&(b==2)&&(c==2)) all=2;
|
|
if ((a==2)&&(d==2)&&(g==2)) all=2;
|
|
if ((a==2)&&(e==2)&&(i==2)) all=2;
|
|
if ((b==2)&&(e==2)&&(h==2)) all=2;
|
|
if ((d==2)&&(e==2)&&(f==2)) all=2;
|
|
if ((g==2)&&(h==2)&&(i==2)) all=2;
|
|
if ((c==2)&&(f==2)&&(i==2)) all=2;
|
|
if ((g==2)&&(e==2)&&(c==2)) all=2;
|
|
if ((a != 0)&&(b != 0)&&(c != 0)&&(d != 0)&&(e != 0)&&(f != 0)&&(g != 0)&&(h != 0)&&(i != 0)&&(all == 0)) all = 3;
|
|
}
|
|
function logicTwo() {
|
|
if ((a==2)&&(b==2)&&(c== 0)&&(temp=="")) temp="C";
|
|
if ((a==2)&&(b== 0)&&(c==2)&&(temp=="")) temp="B";
|
|
if ((a== 0)&&(b==2)&&(c==2)&&(temp=="")) temp="A";
|
|
if ((a==2)&&(d==2)&&(g== 0)&&(temp=="")) temp="G";
|
|
if ((a==2)&&(d== 0)&&(g==2)&&(temp=="")) temp="D";
|
|
if ((a== 0)&&(d==2)&&(g==2)&&(temp=="")) temp="A";
|
|
if ((a==2)&&(e==2)&&(i== 0)&&(temp=="")) temp="I";
|
|
if ((a==2)&&(e== 0)&&(i==2)&&(temp=="")) temp="E";
|
|
if ((a== 0)&&(e==2)&&(i==2)&&(temp=="")) temp="A";
|
|
if ((b==2)&&(e==2)&&(h== 0)&&(temp=="")) temp="H";
|
|
if ((b==2)&&(e== 0)&&(h==2)&&(temp=="")) temp="E";
|
|
if ((b== 0)&&(e==2)&&(h==2)&&(temp=="")) temp="B";
|
|
if ((d==2)&&(e==2)&&(f== 0)&&(temp=="")) temp="F";
|
|
if ((d==2)&&(e== 0)&&(f==2)&&(temp=="")) temp="E";
|
|
if ((d== 0)&&(e==2)&&(f==2)&&(temp=="")) temp="D";
|
|
if ((g==2)&&(h==2)&&(i== 0)&&(temp=="")) temp="I";
|
|
if ((g==2)&&(h== 0)&&(i==2)&&(temp=="")) temp="H";
|
|
if ((g== 0)&&(h==2)&&(i==2)&&(temp=="")) temp="G";
|
|
if ((c==2)&&(f==2)&&(i== 0)&&(temp=="")) temp="I";
|
|
if ((c==2)&&(f== 0)&&(i==2)&&(temp=="")) temp="F";
|
|
if ((c== 0)&&(f==2)&&(i==2)&&(temp=="")) temp="C";
|
|
if ((g==2)&&(e==2)&&(c== 0)&&(temp=="")) temp="C";
|
|
if ((g==2)&&(e== 0)&&(c==2)&&(temp=="")) temp="E";
|
|
if ((g== 0)&&(e==2)&&(c==2)&&(temp=="")) temp="G";
|
|
}
|
|
function logicThree() {
|
|
if ((a==1)&&(b==1)&&(c==0)&&(temp=="")) temp="C";
|
|
if ((a==1)&&(b==0)&&(c==1)&&(temp=="")) temp="B";
|
|
if ((a==0)&&(b==1)&&(c==1)&&(temp=="")) temp="A";
|
|
if ((a==1)&&(d==1)&&(g==0)&&(temp=="")) temp="G";
|
|
if ((a==1)&&(d==0)&&(g==1)&&(temp=="")) temp="D";
|
|
if ((a==0)&&(d==1)&&(g==1)&&(temp=="")) temp="A";
|
|
if ((a==1)&&(e==1)&&(i==0)&&(temp=="")) temp="I";
|
|
if ((a==1)&&(e==0)&&(i==1)&&(temp=="")) temp="E";
|
|
if ((a==0)&&(e==1)&&(i==1)&&(temp=="")) temp="A";
|
|
if ((b==1)&&(e==1)&&(h==0)&&(temp=="")) temp="H";
|
|
if ((b==1)&&(e==0)&&(h==1)&&(temp=="")) temp="E";
|
|
if ((b==0)&&(e==1)&&(h==1)&&(temp=="")) temp="B";
|
|
if ((d==1)&&(e==1)&&(f==0)&&(temp=="")) temp="F";
|
|
if ((d==1)&&(e==0)&&(f==1)&&(temp=="")) temp="E";
|
|
if ((d==0)&&(e==1)&&(f==1)&&(temp=="")) temp="D";
|
|
if ((g==1)&&(h==1)&&(i==0)&&(temp=="")) temp="I";
|
|
if ((g==1)&&(h==0)&&(i==1)&&(temp=="")) temp="H";
|
|
if ((g==0)&&(h==1)&&(i==1)&&(temp=="")) temp="G";
|
|
if ((c==1)&&(f==1)&&(i==0)&&(temp=="")) temp="I";
|
|
if ((c==1)&&(f==0)&&(i==1)&&(temp=="")) temp="F";
|
|
if ((c==0)&&(f==1)&&(i==1)&&(temp=="")) temp="C";
|
|
if ((g==1)&&(e==1)&&(c==0)&&(temp=="")) temp="C";
|
|
if ((g==1)&&(e==0)&&(c==1)&&(temp=="")) temp="E";
|
|
if ((g==0)&&(e==1)&&(c==1)&&(temp=="")) temp="G";
|
|
}
|
|
function clearOut() {
|
|
document.game.you.value="0";
|
|
document.game.computer.value="0";
|
|
document.game.ties.value="0";
|
|
}
|
|
function checkSpace() {
|
|
if ((temp=="A")&&(a==0)) {
|
|
ok=1;
|
|
if (cf==0) a=1;
|
|
if (cf==1) a=2;
|
|
}
|
|
if ((temp=="B")&&(b==0)) {
|
|
ok=1;
|
|
if (cf==0) b=1;
|
|
if (cf==1) b=2;
|
|
}
|
|
if ((temp=="C")&&(c==0)) {
|
|
ok=1;
|
|
if (cf==0) c=1;
|
|
if (cf==1) c=2;
|
|
}
|
|
if ((temp=="D")&&(d==0)) {
|
|
ok=1;
|
|
if (cf==0) d=1;
|
|
if (cf==1) d=2;
|
|
}
|
|
if ((temp=="E")&&(e==0)) {
|
|
ok=1;
|
|
if (cf==0) e=1;
|
|
if (cf==1) e=2;
|
|
}
|
|
if ((temp=="F")&&(f==0)) {
|
|
ok=1
|
|
if (cf==0) f=1;
|
|
if (cf==1) f=2;
|
|
}
|
|
if ((temp=="G")&&(g==0)) {
|
|
ok=1
|
|
if (cf==0) g=1;
|
|
if (cf==1) g=2;
|
|
}
|
|
if ((temp=="H")&&(h==0)) {
|
|
ok=1;
|
|
if (cf==0) h=1;
|
|
if (cf==1) h=2;
|
|
}
|
|
if ((temp=="I")&&(i==0)) {
|
|
ok=1;
|
|
if (cf==0) i=1;
|
|
if (cf==1) i=2;
|
|
}
|
|
}
|
|
function yourChoice(chName) {
|
|
pause = 0;
|
|
if (all!=0) ended();
|
|
if (all==0) {
|
|
cf = 0;
|
|
ok = 0;
|
|
temp=chName;
|
|
checkSpace();
|
|
if (ok==1) {
|
|
document.images[chName].src = x;
|
|
}
|
|
if (ok==0)taken();
|
|
process();
|
|
if ((all==0)&&(pause==0)) myChoice();
|
|
}
|
|
}
|
|
function taken() {
|
|
alert("That square is already occupied. Please select another square.")
|
|
pause=1;
|
|
}
|
|
function myChoice() {
|
|
temp="";
|
|
ok = 0;
|
|
cf=1;
|
|
logicTwo();
|
|
logicThree();
|
|
checkSpace();
|
|
while(ok==0) {
|
|
aRandomNumber=Math.random()
|
|
comp=Math.round((choice-1)*aRandomNumber)+1;
|
|
if (comp==1) temp="A";
|
|
if (comp==2) temp="B";
|
|
if (comp==3) temp="C";
|
|
if (comp==4) temp="D";
|
|
if (comp==5) temp="E";
|
|
if (comp==6) temp="F";
|
|
if (comp==7) temp="G";
|
|
if (comp==8) temp="H";
|
|
if (comp==9) temp="I";
|
|
checkSpace();
|
|
}
|
|
document.images[temp].src= o;
|
|
process();
|
|
}
|
|
function ended() {
|
|
alert("The game has already ended. To play a new game click the Play Again button.")
|
|
}
|
|
function process() {
|
|
logicOne();
|
|
if (all==1){ alert("You won, congratulations!"); wn++; }
|
|
if (all==2){ alert("Gotcha! I win!"); ls++; }
|
|
if (all==3){ alert("We tied."); ts++; }
|
|
if (all!=0) {
|
|
document.game.you.value = wn;
|
|
document.game.computer.value = ls;
|
|
document.game.ties.value = ts;
|
|
}
|
|
}
|
|
function playAgain() {
|
|
if (all==0) {
|
|
if(confirm("This will restart the game and clear all the current scores. OK?")) reset();
|
|
}
|
|
if (all>0) reset();
|
|
}
|
|
function reset() {
|
|
all = 0;
|
|
a = 0;
|
|
b = 0;
|
|
c = 0;
|
|
d = 0;
|
|
e = 0;
|
|
f = 0;
|
|
g = 0;
|
|
h = 0;
|
|
i = 0;
|
|
temp="";
|
|
ok = 0;
|
|
cf = 0;
|
|
choice=9;
|
|
aRandomNumber = 0;
|
|
comp = 0;
|
|
document.images.A.src= blank;
|
|
document.images.B.src= blank;
|
|
document.images.C.src= blank;
|
|
document.images.D.src= blank;
|
|
document.images.E.src= blank;
|
|
document.images.F.src= blank;
|
|
document.images.G.src= blank;
|
|
document.images.H.src= blank;
|
|
document.images.I.src= blank;
|
|
if (t==0) { t=2; myChoice(); }
|
|
t--;
|
|
}
|
|
// End -->
|
|
</script>
|
|
|
|
|
|
|
|
<center>
|
|
<form name="game" id="game">
|
|
<table border="0">
|
|
<tr><td>
|
|
<table border="1">
|
|
<tr>
|
|
<td><a href="javascript:yourChoice('A')"><img src="images/ttt-blank.jpg" alt="Top-Left" name="A" width="100" height="100" border="0" id="A" /></a></td>
|
|
<td><a href="javascript:yourChoice('B')"><img src="images/ttt-blank.jpg" alt="Top-Center" name="B" width="100" height="100" border="0" id="B" /></a></td>
|
|
<td><a href="javascript:yourChoice('C')"><img src="images/ttt-blank.jpg" alt="Top-Right" name="C" width="100" height="100" border="0" id="C" /></a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><a href="javascript:yourChoice('D')"><img src="images/ttt-blank.jpg" alt="Middle-Left" name="D" width="100" height="100" border="0" id="D" /></a></td>
|
|
<td><a href="javascript:yourChoice('E')"><img src="images/ttt-blank.jpg" alt="Middle-Center" name="E" width="100" height="100" border="0" id="E" /></a></td>
|
|
<td><a href="javascript:yourChoice('F')"><img src="images/ttt-blank.jpg" alt="Middle-Right" name="F" width="100" height="100" border="0" id="F" /></a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><a href="javascript:yourChoice('G')"><img src="images/ttt-blank.jpg" alt="Bottom-Left" name="G" width="100" height="100" border="0" id="G" /></a></td>
|
|
<td><a href="javascript:yourChoice('H')"><img src="images/ttt-blank.jpg" alt="Bottom-Center" name="H" width="100" height="100" border="0" id="H" /></a></td>
|
|
<td><a href="javascript:yourChoice('I')"><img src="images/ttt-blank.jpg" alt="Bottom-Right" name="I" width="100" height="100" border="0" id="I" /></a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<input type="text" size="5" name="you" />
|
|
</td>
|
|
<td>You</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<input type="text" size="5" name="computer" />
|
|
</td>
|
|
<td>Computer</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<input type="text" size="5" name="ties" />
|
|
</td>
|
|
<td>Ties</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr></table>
|
|
<input type="button" value="Play Again" onClick="playAgain();" />
|
|
|
|
</form>
|
|
</center>
|
|
<br />
|
|
<br />
|
|
<p class="tiny">Free JavaScripts provided by <a href="http://javascriptsource.com/">The JavaScript Source</a>
|
|
</p>
|
|
<div class="related">
|
|
<a href="index.html">Games Index</a>
|
|
<a href="index-html5.html">HTML5 Games</a>
|
|
<a href="index-flash.html">Flash Games</a>
|
|
<a href="index-elementary.html">Elementary Games</a>
|
|
<a href="puzzle-games.html">Puzzle Games</a>
|
|
</div>
|
|
<!-- #EndEditable --></div>
|
|
<div id="adend" class="centerfull noprint">
|
|
<script type="text/javascript">document.write(getAdEnd());</script>
|
|
</div>
|
|
<div id="footer" class="centerfull noprint">
|
|
<script type="text/javascript">document.write(getFooter());</script>
|
|
</div>
|
|
<div id="copyrt">
|
|
Copyright © 2018 MathsIsFun.com
|
|
</div>
|
|
|
|
<script type="text/javascript">document.write(getBodyEnd());</script>
|
|
</body>
|
|
<!-- #EndTemplate -->
|
|
<!-- Mirrored from www.mathsisfun.com/games/tic-tac-toe-old.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 01:06:43 GMT -->
|
|
</html>
|