Click here to play Tic Tac Toe


SUBMITTED BY: Guest

DATE: Dec. 5, 2013, 9:48 a.m.

FORMAT: JavaScript

SIZE: 21.8 kB

HITS: 1146

  1. <SCRIPT>
  2. /*
  3. Code Written by Cory Fogliani (Email: cory@ijustdontcare.com)
  4. Testers: Cory Fogliani, Chris Gordon
  5. Featured on JavaScript Kit (http://javascriptkit.com)
  6. For this and over 400+ free scripts, visit http://javascriptkit.com
  7. */
  8. //if IE4/NS6, apply style
  9. if (document.all||document.getElementById){
  10. document.write('<style>.tictac{')
  11. document.write('width:50px;height:50px;')
  12. document.write('}</style>')
  13. }
  14. var sqr1
  15. var sqr2
  16. var sqr3
  17. var sqr4
  18. var sqr5
  19. var sqr6
  20. var sqr7
  21. var sqr8
  22. var sqr9
  23. var sqr1T = 0
  24. var sqr2T = 0
  25. var sqr3T = 0
  26. var sqr4T = 0
  27. var sqr5T = 0
  28. var sqr6T = 0
  29. var sqr7T = 0
  30. var sqr8T = 0
  31. var sqr9T = 0
  32. var moveCount = 0
  33. var turn = 0
  34. var mode = 1
  35. function vari()
  36. {
  37. sqr1 = document.tic.sqr1.value
  38. sqr2 = document.tic.sqr2.value
  39. sqr3 = document.tic.sqr3.value
  40. sqr4 = document.tic.sqr4.value
  41. sqr5 = document.tic.sqr5.value
  42. sqr6 = document.tic.sqr6.value
  43. sqr7 = document.tic.sqr7.value
  44. sqr8 = document.tic.sqr8.value
  45. sqr9 = document.tic.sqr9.value
  46. }
  47. function check()
  48. {
  49. if(sqr1 == " X " && sqr2 == " X " && sqr3 == " X ")
  50. {
  51. alert("You Win!")
  52. reset()
  53. }
  54. else if(sqr4 == " X " && sqr5 == " X " && sqr6 == " X ")
  55. {
  56. alert("You Win!")
  57. reset()
  58. }
  59. else if(sqr7 == " X " && sqr8 == " X " && sqr9 == " X ")
  60. {
  61. alert("You Win!")
  62. reset()
  63. }
  64. else if(sqr1 == " X " && sqr5 == " X " && sqr9 == " X ")
  65. {
  66. alert("You Win!")
  67. reset()
  68. }
  69. else if(sqr1 == " X " && sqr4 == " X " && sqr7 == " X ")
  70. {
  71. alert("You Win!")
  72. reset()
  73. }
  74. else if(sqr2 == " X " && sqr5 == " X " && sqr8 == " X ")
  75. {
  76. alert("You Win!")
  77. reset()
  78. }
  79. else if(sqr3 == " X " && sqr6 == " X " && sqr9 == " X ")
  80. {
  81. alert("You Win!")
  82. reset()
  83. }
  84. else if(sqr1 == " X " && sqr5 == " X " && sqr9 == " X ")
  85. {
  86. alert("You Win!")
  87. reset()
  88. }
  89. else if(sqr3 == " X " && sqr5 == " X " && sqr7 == " X ")
  90. {
  91. alert("You Win!")
  92. reset()
  93. }
  94. else
  95. {
  96. winCheck()
  97. check2()
  98. drawCheck()
  99. }
  100. }
  101. function check2()
  102. {
  103. vari()
  104. drawCheck()
  105. if(sqr1 == " O " && sqr2 == " O " && sqr3 == " O ")
  106. {
  107. alert("You Lose!")
  108. reset()
  109. }
  110. else if(sqr4 == " O " && sqr5 == " O " && sqr6 == " O ")
  111. {
  112. alert("You Lose!")
  113. reset()
  114. }
  115. else if(sqr7 == " O " && sqr8 == " O " && sqr9 == " O ")
  116. {
  117. alert("You Lose!")
  118. reset()
  119. }
  120. else if(sqr1 == " O " && sqr5 == " O " && sqr9 == " O ")
  121. {
  122. alert("You Lose!")
  123. reset()
  124. }
  125. else if(sqr1 == " O " && sqr4 == " O " && sqr7 == " O ")
  126. {
  127. alert("You Lose!")
  128. reset()
  129. }
  130. else if(sqr2 == " O " && sqr5 == " O " && sqr8 == " O ")
  131. {
  132. alert("You Lose!")
  133. reset()
  134. }
  135. else if(sqr3 == " O " && sqr6 == " O " && sqr9 == " O ")
  136. {
  137. alert("You Lose!")
  138. reset()
  139. }
  140. else if(sqr1 == " O " && sqr5 == " O " && sqr9 == " O ")
  141. {
  142. alert("You Lose!")
  143. reset()
  144. }
  145. else if(sqr3 == " O " && sqr5 == " O " && sqr7 == " O ")
  146. {
  147. alert("You Lose!")
  148. reset()
  149. }
  150. }
  151. function player1Check()
  152. {
  153. if(sqr1 == " X " && sqr2 == " X " && sqr3 == " X ")
  154. {
  155. alert("Player 1 wins!")
  156. reset()
  157. }
  158. else if(sqr4 == " X " && sqr5 == " X " && sqr6 == " X ")
  159. {
  160. alert("Player 1 wins!")
  161. reset()
  162. }
  163. else if(sqr7 == " X " && sqr8 == " X " && sqr9 == " X ")
  164. {
  165. alert("Player 1 wins!")
  166. reset()
  167. }
  168. else if(sqr1 == " X " && sqr5 == " X " && sqr9 == " X ")
  169. {
  170. alert("Player 1 wins!")
  171. reset()
  172. }
  173. else if(sqr1 == " X " && sqr4 == " X " && sqr7 == " X ")
  174. {
  175. alert("Player 1 wins!")
  176. reset()
  177. }
  178. else if(sqr2 == " X " && sqr5 == " X " && sqr8 == " X ")
  179. {
  180. alert("Player 1 wins!")
  181. reset()
  182. }
  183. else if(sqr3 == " X " && sqr6 == " X " && sqr9 == " X ")
  184. {
  185. alert("Player 1 wins!")
  186. reset()
  187. }
  188. else if(sqr1 == " X " && sqr5 == " X " && sqr9 == " X ")
  189. {
  190. alert("Player 1 wins!")
  191. reset()
  192. }
  193. else if(sqr3 == " X " && sqr5 == " X " && sqr7 == " X ")
  194. {
  195. alert("Player 1 wins!")
  196. reset()
  197. }
  198. else
  199. {
  200. player2Check()
  201. drawCheck()
  202. }
  203. }
  204. function player2Check()
  205. {
  206. vari()
  207. drawCheck()
  208. if(sqr1 == " O " && sqr2 == " O " && sqr3 == " O ")
  209. {
  210. alert("Player 2 wins!")
  211. reset()
  212. }
  213. else if(sqr4 == " O " && sqr5 == " O " && sqr6 == " O ")
  214. {
  215. alert("Player 2 wins!")
  216. reset()
  217. }
  218. else if(sqr7 == " O " && sqr8 == " O " && sqr9 == " O ")
  219. {
  220. alert("Player 2 wins!")
  221. reset()
  222. }
  223. else if(sqr1 == " O " && sqr5 == " O " && sqr9 == " O ")
  224. {
  225. alert("Player 2 wins!")
  226. reset()
  227. }
  228. else if(sqr1 == " O " && sqr4 == " O " && sqr7 == " O ")
  229. {
  230. alert("Player 2 wins!")
  231. reset()
  232. }
  233. else if(sqr2 == " O " && sqr5 == " O " && sqr8 == " O ")
  234. {
  235. alert("Player 2 wins!")
  236. reset()
  237. }
  238. else if(sqr3 == " O " && sqr6 == " O " && sqr9 == " O ")
  239. {
  240. alert("Player 2 wins!")
  241. reset()
  242. }
  243. else if(sqr1 == " O " && sqr5 == " O " && sqr9 == " O ")
  244. {
  245. alert("Player 2 wins!")
  246. reset()
  247. }
  248. else if(sqr3 == " O " && sqr5 == " O " && sqr7 == " O ")
  249. {
  250. alert("Player 2 wins!")
  251. reset()
  252. }
  253. }
  254. function drawCheck()
  255. {
  256. vari()
  257. moveCount = sqr1T + sqr2T + sqr3T + sqr4T + sqr5T + sqr6T + sqr7T + sqr8T + sqr9T
  258. if(moveCount == 9)
  259. {
  260. reset()
  261. alert("Draw")
  262. }
  263. }
  264. function winCheck()
  265. {
  266. check2()
  267. if(sqr1 == " O " && sqr2 == " O " && sqr3T == 0 && turn == 1)
  268. {
  269. document.tic.sqr3.value = " O "
  270. sqr3T = 1;
  271. turn = 0;
  272. }
  273. else if(sqr2 == " O " && sqr3 == " O " && sqr1T == 0 && turn == 1)
  274. {
  275. document.tic.sqr1.value = " O "
  276. sqr1T = 1;
  277. turn = 0;
  278. }
  279. else if(sqr4 == " O " && sqr5 == " O " && sqr6T == 0 && turn == 1)
  280. {
  281. document.tic.sqr6.value = " O "
  282. sqr6T = 1;
  283. turn = 0;
  284. }
  285. else if(sqr5 == " O " && sqr6 == " O " && sqr4T == 0 && turn == 1)
  286. {
  287. document.tic.sqr4.value = " O "
  288. sqr4T = 1;
  289. turn = 0;
  290. }
  291. else if(sqr7 == " O " && sqr8 == " O " && sqr9T == 0 && turn == 1)
  292. {
  293. document.tic.sqr9.value = " O "
  294. sqr9T = 1;
  295. turn = 0;
  296. }
  297. else if(sqr8 == " O " && sqr9 == " O " && sqr7T == 0 && turn == 1)
  298. {
  299. document.tic.sqr7.value = " O "
  300. sqr7T = 1;
  301. turn = 0;
  302. }
  303. else if(sqr1 == " O " && sqr5 == " O " && sqr9T == 0 && turn == 1)
  304. {
  305. document.tic.sqr9.value = " O "
  306. sqr9T = 1;
  307. turn = 0;
  308. }
  309. else if(sqr5 == " O " && sqr9 == " O " && sqr1T == 0 && turn == 1)
  310. {
  311. document.tic.sqr1.value = " O "
  312. sqr1T = 1;
  313. turn = 0;
  314. }
  315. else if(sqr3 == " O " && sqr5 == " O " && sqr7T == 0 && turn == 1)
  316. {
  317. document.tic.sqr7.value = " O "
  318. sqr7T = 1;
  319. turn = 0;
  320. }
  321. else if(sqr7 == " O " && sqr5 == " O " && sqr3T == 0 && turn == 1)
  322. {
  323. document.tic.sqr3.value = " O "
  324. sqr3T = 1;
  325. turn = 0;
  326. }
  327. else if(sqr1 == " O " && sqr3 == " O " && sqr2T == 0 && turn == 1)
  328. {
  329. document.tic.sqr2.value = " O "
  330. sqr2T = 1;
  331. turn = 0;
  332. }
  333. else if(sqr4 == " O " && sqr6 == " O " && sqr5T == 0 && turn == 1)
  334. {
  335. document.tic.sqr5.value = " O "
  336. sqr5T = 1;
  337. turn = 0;
  338. }
  339. else if(sqr7 == " O " && sqr9 == " O " && sqr8T == 0 && turn == 1)
  340. {
  341. document.tic.sqr8.value = " O "
  342. sqr8T = 1;
  343. turn = 0;
  344. }
  345. else if(sqr1 == " O " && sqr7 == " O " && sqr4T == 0 && turn == 1)
  346. {
  347. document.tic.sqr4.value = " O "
  348. sqr4T = 1;
  349. turn = 0;
  350. }
  351. else if(sqr2 == " O " && sqr8 == " O " && sqr5T == 0 && turn == 1)
  352. {
  353. document.tic.sqr5.value = " O "
  354. sqr5T = 1;
  355. turn = 0;
  356. }
  357. else if(sqr3 == " O " && sqr9 == " O " && sqr6T == 0 && turn == 1)
  358. {
  359. document.tic.sqr6.value = " O "
  360. sqr6T = 1;
  361. turn = 0;
  362. }
  363. else if(sqr1 == " O " && sqr5 == " O " && sqr9T == 0 && turn == 1)
  364. {
  365. document.tic.sqr9.value = " O "
  366. sqr9T = 1;
  367. turn = 0;
  368. }
  369. else if(sqr4 == " O " && sqr7 == " O " && sqr1T == 0 && turn == 1)
  370. {
  371. document.tic.sqr1.value = " O "
  372. sqr1T = 1;
  373. turn = 0;
  374. }
  375. else if(sqr5 == " O " && sqr8 == " O " && sqr2T == 0 && turn == 1)
  376. {
  377. document.tic.sqr2.value = " O "
  378. sqr2T = 1;
  379. turn = 0;
  380. }
  381. else if(sqr6 == " O " && sqr9 == " O " && sqr3T == 0 && turn == 1)
  382. {
  383. document.tic.sqr3.value = " O "
  384. sqr3T = 1;
  385. turn = 0;
  386. }
  387. else if(sqr1 == " O " && sqr4 == " O " && sqr7T == 0 && turn == 1)
  388. {
  389. document.tic.sqr7.value = " O "
  390. sqr7T = 1;
  391. turn = 0;
  392. }
  393. else if(sqr2 == " O " && sqr5 == " O " && sqr8T == 0 && turn == 1)
  394. {
  395. document.tic.sqr8.value = " O "
  396. sqr8T = 1;
  397. turn = 0;
  398. }
  399. else if(sqr3 == " O " && sqr6 == " O " && sqr9T == 0 && turn == 1)
  400. {
  401. document.tic.sqr9.value = " O "
  402. sqr9T = 1;
  403. turn = 0;
  404. }
  405. else if(sqr1 == " O " && sqr9 == " O " && sqr5T == 0 && turn == 1)
  406. {
  407. document.tic.sqr5.value = " O "
  408. sqr5T = 1;
  409. turn = 0;
  410. }
  411. else if(sqr3 == " O " && sqr7 == " O " && sqr5T == 0 && turn == 1)
  412. {
  413. document.tic.sqr5.value = " O "
  414. sqr5T = 1;
  415. turn = 0;
  416. }
  417. else
  418. {
  419. computer()
  420. }
  421. check2()
  422. }
  423. function computer()
  424. {
  425. check2()
  426. if(sqr1 == " X " && sqr2 == " X " && sqr3T == 0 && turn == 1)
  427. {
  428. document.tic.sqr3.value = " O "
  429. sqr3T = 1;
  430. turn = 0;
  431. }
  432. else if(sqr2 == " X " && sqr3 == " X " && sqr1T == 0 && turn == 1)
  433. {
  434. document.tic.sqr1.value = " O "
  435. sqr1T = 1;
  436. turn = 0;
  437. }
  438. else if(sqr4 == " X " && sqr5 == " X " && sqr6T == 0 && turn == 1)
  439. {
  440. document.tic.sqr6.value = " O "
  441. sqr6T = 1;
  442. turn = 0;
  443. }
  444. else if(sqr5 == " X " && sqr6 == " X " && sqr4T == 0 && turn == 1)
  445. {
  446. document.tic.sqr4.value = " O "
  447. sqr4T = 1;
  448. turn = 0;
  449. }
  450. else if(sqr7 == " X " && sqr8 == " X " && sqr9T == 0 && turn == 1)
  451. {
  452. document.tic.sqr9.value = " O "
  453. sqr9T = 1;
  454. turn = 0;
  455. }
  456. else if(sqr8 == " X " && sqr9 == " X " && sqr7T == 0 && turn == 1)
  457. {
  458. document.tic.sqr7.value = " O "
  459. sqr7T = 1;
  460. turn = 0;
  461. }
  462. else if(sqr1 == " X " && sqr5 == " X " && sqr9T == 0 && turn == 1)
  463. {
  464. document.tic.sqr9.value = " O "
  465. sqr9T = 1;
  466. turn = 0;
  467. }
  468. else if(sqr5 == " X " && sqr9 == " X " && sqr1T == 0 && turn == 1)
  469. {
  470. document.tic.sqr1.value = " O "
  471. sqr1T = 1;
  472. turn = 0;
  473. }
  474. else if(sqr3 == " X " && sqr5 == " X " && sqr7T == 0 && turn == 1)
  475. {
  476. document.tic.sqr7.value = " O "
  477. sqr7T = 1;
  478. turn = 0;
  479. }
  480. else if(sqr7 == " X " && sqr5 == " X " && sqr3T == 0 && turn == 1)
  481. {
  482. document.tic.sqr3.value = " O "
  483. sqr3T = 1;
  484. turn = 0;
  485. }
  486. else if(sqr1 == " X " && sqr3 == " X " && sqr2T == 0 && turn == 1)
  487. {
  488. document.tic.sqr2.value = " O "
  489. sqr2T = 1;
  490. turn = 0;
  491. }
  492. else if(sqr4 == " X " && sqr6 == " X " && sqr5T == 0 && turn == 1)
  493. {
  494. document.tic.sqr5.value = " O "
  495. sqr5T = 1;
  496. turn = 0;
  497. }
  498. else if(sqr7 == " X " && sqr9 == " X " && sqr8T == 0 && turn == 1)
  499. {
  500. document.tic.sqr8.value = " O "
  501. sqr8T = 1;
  502. turn = 0;
  503. }
  504. else if(sqr1 == " X " && sqr7 == " X " && sqr4T == 0 && turn == 1)
  505. {
  506. document.tic.sqr4.value = " O "
  507. sqr4T = 1;
  508. turn = 0;
  509. }
  510. else if(sqr2 == " X " && sqr8 == " X " && sqr5T == 0 && turn == 1)
  511. {
  512. document.tic.sqr5.value = " O "
  513. sqr5T = 1;
  514. turn = 0;
  515. }
  516. else if(sqr3 == " X " && sqr9 == " X " && sqr6T == 0 && turn == 1)
  517. {
  518. document.tic.sqr6.value = " O "
  519. sqr6T = 1;
  520. turn = 0;
  521. }
  522. else if(sqr1 == " X " && sqr5 == " X " && sqr9T == 0 && turn == 1)
  523. {
  524. document.tic.sqr9.value = " O "
  525. sqr9T = 1;
  526. turn = 0;
  527. }
  528. else if(sqr4 == " X " && sqr7 == " X " && sqr1T == 0 && turn == 1)
  529. {
  530. document.tic.sqr1.value = " O "
  531. sqr1T = 1;
  532. turn = 0;
  533. }
  534. else if(sqr5 == " X " && sqr8 == " X " && sqr2T == 0 && turn == 1)
  535. {
  536. document.tic.sqr2.value = " O "
  537. sqr2T = 1;
  538. turn = 0;
  539. }
  540. else if(sqr6 == " X " && sqr9 == " X " && sqr3T == 0 && turn == 1)
  541. {
  542. document.tic.sqr3.value = " O "
  543. sqr3T = 1;
  544. turn = 0;
  545. }
  546. else if(sqr1 == " X " && sqr4 == " X " && sqr7T == 0 && turn == 1)
  547. {
  548. document.tic.sqr7.value = " O "
  549. sqr7T = 1;
  550. turn = 0;
  551. }
  552. else if(sqr2 == " X " && sqr5 == " X " && sqr8T == 0 && turn == 1)
  553. {
  554. document.tic.sqr8.value = " O "
  555. sqr8T = 1;
  556. turn = 0;
  557. }
  558. else if(sqr3 == " X " && sqr6 == " X " && sqr9T == 0 && turn == 1)
  559. {
  560. document.tic.sqr9.value = " O "
  561. sqr9T = 1;
  562. turn = 0;
  563. }
  564. else if(sqr1 == " X " && sqr9 == " X " && sqr5T == 0 && turn == 1)
  565. {
  566. document.tic.sqr5.value = " O "
  567. sqr5T = 1;
  568. turn = 0;
  569. }
  570. else if(sqr3 == " X " && sqr7 == " X " && sqr5T == 0 && turn == 1)
  571. {
  572. document.tic.sqr5.value = " O "
  573. sqr5T = 1;
  574. turn = 0;
  575. }
  576. else
  577. {
  578. AI()
  579. }
  580. check2()
  581. }
  582. function AI()
  583. {
  584. vari()
  585. if(document.tic.sqr5.value == " " && turn == 1)
  586. {
  587. document.tic.sqr5.value = " O "
  588. turn = 0
  589. sqr5T = 1
  590. }
  591. else if(document.tic.sqr1.value == " " && turn == 1)
  592. {
  593. document.tic.sqr1.value = " O "
  594. turn = 0
  595. sqr1T = 1
  596. }
  597. else if(document.tic.sqr9.value == " " && turn == 1)
  598. {
  599. document.tic.sqr9.value = " O "
  600. turn = 0
  601. sqr9T = 1
  602. }
  603. else if(document.tic.sqr6.value == " " && turn == 1)
  604. {
  605. document.tic.sqr6.value = " O "
  606. turn = 0
  607. sqr6T = 1
  608. }
  609. else if(document.tic.sqr2.value == " " && turn == 1)
  610. {
  611. document.tic.sqr2.value = " O "
  612. turn = 0
  613. sqr2T = 1
  614. }
  615. else if(document.tic.sqr8.value == " " && turn == 1)
  616. {
  617. document.tic.sqr8.value = " O "
  618. turn = 0
  619. sqr8T = 1
  620. }
  621. else if(document.tic.sqr3.value == " " && turn == 1)
  622. {
  623. document.tic.sqr3.value = " O "
  624. turn = 0
  625. sqr3T = 1
  626. }
  627. else if(document.tic.sqr7.value == " " && turn == 1)
  628. {
  629. document.tic.sqr7.value = " O "
  630. turn = 0
  631. sqr7T = 1
  632. }
  633. else if(document.tic.sqr4.value == " " && turn == 1)
  634. {
  635. document.tic.sqr4.value = " O "
  636. turn = 0
  637. sqr4T = 1
  638. }
  639. check2()
  640. }
  641. function reset()
  642. {
  643. document.tic.sqr1.value = " "
  644. document.tic.sqr2.value = " "
  645. document.tic.sqr3.value = " "
  646. document.tic.sqr4.value = " "
  647. document.tic.sqr5.value = " "
  648. document.tic.sqr6.value = " "
  649. document.tic.sqr7.value = " "
  650. document.tic.sqr8.value = " "
  651. document.tic.sqr9.value = " "
  652. sqr1T = 0
  653. sqr2T = 0
  654. sqr3T = 0
  655. sqr4T = 0
  656. sqr5T = 0
  657. sqr6T = 0
  658. sqr7T = 0
  659. sqr8T = 0
  660. sqr9T = 0
  661. vari()
  662. turn = 0
  663. moveCount = 0
  664. }
  665. function resetter()
  666. {
  667. reset()
  668. }
  669. </SCRIPT>
  670. <FORM NAME="tic">
  671. <INPUT TYPE="button" NAME="sqr1" class="tictac" value=" " onClick="if(document.tic.sqr1.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr1.value = ' X '; sqr1T = 1; turn = 1; vari(); check();} else if(document.tic.sqr1.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr1.value = ' X '; sqr1T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr1.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr1.value = ' O '; sqr1T = 1; turn = 1; vari(); player1Check()} drawCheck()">
  672. <INPUT TYPE="button" NAME="sqr2" class="tictac" value=" " onClick="if(document.tic.sqr2.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr2.value = ' X '; sqr2T = 1; turn = 1; vari(); check();} else if(document.tic.sqr2.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr2.value = ' X '; sqr2T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr2.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr2.value = ' O '; sqr2T = 1; turn = 1; vari(); player1Check()} drawCheck()">
  673. <INPUT TYPE="button" NAME="sqr3" class="tictac" value=" " onClick="if(document.tic.sqr3.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr3.value = ' X '; sqr3T = 1; turn = 1; vari(); check();} else if(document.tic.sqr3.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr3.value = ' X '; sqr3T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr3.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr3.value = ' O '; sqr3T = 1; turn = 1; vari(); player1Check()} drawCheck()"><br />
  674. <INPUT TYPE="button" NAME="sqr4" class="tictac" value=" " onClick="if(document.tic.sqr4.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr4.value = ' X '; sqr4T = 1; turn = 1; vari(); check();} else if(document.tic.sqr4.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr4.value = ' X '; sqr4T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr4.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr4.value = ' O '; sqr4T = 1; turn = 1; vari(); player1Check()} drawCheck()">
  675. <INPUT TYPE="button" NAME="sqr5" class="tictac" value=" " onClick="if(document.tic.sqr5.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr5.value = ' X '; sqr5T = 1; turn = 1; vari(); check();} else if(document.tic.sqr5.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr5.value = ' X '; sqr5T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr5.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr5.value = ' O '; sqr5T = 1; turn = 1; vari(); player1Check()} drawCheck()">
  676. <INPUT TYPE="button" NAME="sqr6" class="tictac" value=" " onClick="if(document.tic.sqr6.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr6.value = ' X '; sqr6T = 1; turn = 1; vari(); check();} else if(document.tic.sqr6.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr6.value = ' X '; sqr6T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr6.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr6.value = ' O '; sqr6T = 1; turn = 1; vari(); player1Check()} drawCheck()"><br />
  677. <INPUT TYPE="button" NAME="sqr7" class="tictac" value=" " onClick="if(document.tic.sqr7.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr7.value = ' X '; sqr7T = 1; turn = 1; vari(); check();} else if(document.tic.sqr7.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr7.value = ' X '; sqr7T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr7.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr7.value = ' O '; sqr7T = 1; turn = 1; vari(); player1Check()} drawCheck()">
  678. <INPUT TYPE="button" NAME="sqr8" class="tictac" value=" " onClick="if(document.tic.sqr8.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr8.value = ' X '; sqr8T = 1; turn = 1; vari(); check();} else if(document.tic.sqr8.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr8.value = ' X '; sqr8T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr8.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr8.value = ' O '; sqr8T = 1; turn = 1; vari(); player1Check()} drawCheck()">
  679. <INPUT TYPE="button" NAME="sqr9" class="tictac" value=" " onClick="if(document.tic.sqr9.value == ' ' && turn == 0 && mode == 1) {document.tic.sqr9.value = ' X '; sqr9T = 1; turn = 1; vari(); check();} else if(document.tic.sqr9.value == ' ' && turn == 1 && mode == 2) {document.tic.sqr9.value = ' X '; sqr9T = 1; turn = 0; vari(); player1Check()} else if(document.tic.sqr9.value == ' ' && turn == 0 && mode == 2) {document.tic.sqr9.value = ' O '; sqr9T = 1; turn = 1; vari(); player1Check()} drawCheck()">
  680. </form>

comments powered by Disqus