<table align="center" width="199" class="colorborder"> <tr><td colspan="3"> <div align="center" id="v7Step">step:0</div> </td></tr> <tr> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(0)" id="v7image0" style="cursor:pointer; border:2px solid white"/></center></td> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(1)" id="v7image1" style="cursor:pointer; border:2px solid white"/></center></td> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(2)" id="v7image2" style="cursor:pointer; border:2px solid white"/></center></td> </tr> <tr> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(3)" id="v7image3" style="cursor:pointer; border:2px solid white"/></center></td> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(4)" id="v7image4" style="cursor:pointer; border:2px solid white"/></center></td> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(5)" id="v7image5" style="cursor:pointer; border:2px solid white"/></center></td> </tr> <tr> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(6)" id="v7image6" style="cursor:pointer; border:2px solid white"/></center></td> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(7)" id="v7image7" style="cursor:pointer; border:2px solid white"/></center></td> <td><center><img src="https://sklees.narod.ru/jgame/tictactoy/Im0.jpg" onclick="v7ButtonClick(8)" id="v7image8" style="cursor:pointer; border:2px solid white"/></center></td> </tr> <tr> <td colspan="3"><center><input type="button" onclick="v7NewClick()" value="сначала" /></center></td> </tr> </table> <script> var v7colstep = 0; var v7place = [0, 0, 0, 0, 0, 0, 0, 0, 0]; var v7NumberStep = 0; function v7ButtonClick(NumBut) { if (v7NumberStep == 0) { v7place[NumBut] = 1; v7GoDraw(); v7StepPC(); v7GoDraw(); v7NumberStep=v7NumberStep+2;} if (v7NumberStep == 2) { if (v7place[NumBut] == 0) { v7place[NumBut] = 1; v7GoDraw(); v7StepPC(); v7GoDraw(); v7NumberStep=v7NumberStep+2; }} if (v7NumberStep == 4) { if (v7place[NumBut] == 0) { v7place[NumBut] = 1; v7GoDraw(); v7StepPC(); v7GoDraw(); v7NumberStep=v7NumberStep+2; }} if (v7NumberStep == 6) { if (v7place[NumBut] == 0) { v7place[NumBut] = 1; v7GoDraw(); v7StepPC(); v7GoDraw(); v7NumberStep=v7NumberStep+2; }} if (v7NumberStep == 8) { if (v7place[NumBut] == 0) { v7place[NumBut] = 1; v7GoDraw(); }} } function v7GoDraw() { v7colstep = v7colstep + 1; document.getElementById('v7Step').innerHTML = "step:" + v7colstep; document.getElementById('v7image0').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[0] + ".jpg"; document.getElementById('v7image1').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[1] + ".jpg"; document.getElementById('v7image2').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[2] + ".jpg"; document.getElementById('v7image3').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[3] + ".jpg"; document.getElementById('v7image4').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[4] + ".jpg"; document.getElementById('v7image5').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[5] + ".jpg"; document.getElementById('v7image6').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[6] + ".jpg"; document.getElementById('v7image7').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[7] + ".jpg"; document.getElementById('v7image8').src = "https://sklees.narod.ru/jgame/tictactoy/Im" + v7place[8] + ".jpg"; if (v7place[0] == v7place[2]) { if (v7place[1] == v7place[2]) { if (v7place[2] != 0) { v7NumberStep = 1; document.getElementById('v7image0').style.border = "2px solid blue"; document.getElementById('v7image1').style.border = "2px solid blue"; document.getElementById('v7image2').style.border = "2px solid blue"; }}} if (v7place[3] == v7place[5]) { if (v7place[4] == v7place[5]) { if (v7place[5] != 0) { v7NumberStep = 1; document.getElementById('v7image3').style.border = "2px solid blue"; document.getElementById('v7image4').style.border = "2px solid blue"; document.getElementById('v7image5').style.border = "2px solid blue"; }}} if (v7place[6] == v7place[8]) { if (v7place[7] == v7place[8]) { if (v7place[8] != 0) { v7NumberStep = 1; document.getElementById('v7image6').style.border = "2px solid blue"; document.getElementById('v7image7').style.border = "2px solid blue"; document.getElementById('v7image8').style.border = "2px solid blue"; }}} if (v7place[0] == v7place[6]) { if (v7place[3] == v7place[6]) { if (v7place[6] != 0) { v7NumberStep = 1; document.getElementById('v7image0').style.border = "2px solid blue"; document.getElementById('v7image3').style.border = "2px solid blue"; document.getElementById('v7image6').style.border = "2px solid blue"; }}} if (v7place[1] == v7place[7]) { if (v7place[4] == v7place[7]) { if (v7place[7] != 0) { v7NumberStep = 1; document.getElementById('v7image1').style.border = "2px solid blue"; document.getElementById('v7image4').style.border = "2px solid blue"; document.getElementById('v7image7').style.border = "2px solid blue"; }}} if (v7place[2] == v7place[8]) { if (v7place[5] == v7place[8]) { if (v7place[8] != 0) { v7NumberStep = 1; document.getElementById('v7image2').style.border = "2px solid blue"; document.getElementById('v7image5').style.border = "2px solid blue"; document.getElementById('v7image8').style.border = "2px solid blue"; }}} if (v7place[0] == v7place[8]) { if (v7place[4] == v7place[8]) { if (v7place[8] != 0) { v7NumberStep = 1; document.getElementById('v7image0').style.border = "2px solid blue"; document.getElementById('v7image4').style.border = "2px solid blue"; document.getElementById('v7image8').style.border = "2px solid blue"; }}} if (v7place[2] == v7place[6]) { if (v7place[4] == v7place[6]) { if (v7place[6] != 0) { v7NumberStep = 1; document.getElementById('v7image2').style.border = "2px solid blue"; document.getElementById('v7image4').style.border = "2px solid blue"; document.getElementById('v7image6').style.border = "2px solid blue"; }}} } function v7StepPC() { var v7step1PC = 9; if (v7NumberStep != 1) { if (v7place[0] == 1) { if (v7place[1] == 1) { if (v7place[2] == 0) { v7step1PC = 2;}}} if (v7place[2] == 1) { if (v7place[1] == 1) { if (v7place[0] == 0) { v7step1PC = 0;}}} if (v7place[0] == 1) { if (v7place[2] == 1) { if (v7place[1] == 0) { v7step1PC = 1;}}} if (v7place[3] == 1) { if (v7place[4] == 1) { if (v7place[5] == 0) { v7step1PC = 5;}}} if (v7place[5] == 1) { if (v7place[4] == 1) { if (v7place[3] == 0) { v7step1PC = 3;}}} if (v7place[3] == 1) { if (v7place[5] == 1) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7place[6] == 1) { if (v7place[7] == 1) { if (v7place[8] == 0) { v7step1PC = 8;}}} if (v7place[8] == 1) { if (v7place[7] == 1) { if (v7place[6] == 0) { v7step1PC = 6;}}} if (v7place[6] == 1) { if (v7place[8] == 1) { if (v7place[7] == 0) { v7step1PC = 7;}}} if (v7place[0] == 1) { if (v7place[3] == 1) { if (v7place[6] == 0) { v7step1PC = 6;}}} if (v7place[6] == 1) { if (v7place[3] == 1) { if (v7place[0] == 0) { v7step1PC = 0;}}} if (v7place[0] == 1) { if (v7place[6] == 1) { if (v7place[3] == 0) { v7step1PC = 3;}}} if (v7place[1] == 1) { if (v7place[4] == 1) { if (v7place[7] == 0) { v7step1PC = 7;}}} if (v7place[7] == 1) { if (v7place[4] == 1) { if (v7place[1] == 0) { v7step1PC = 1;}}} if (v7place[1] == 1) { if (v7place[7] == 1) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7place[2] == 1) { if (v7place[5] == 1) { if (v7place[8] == 0) { v7step1PC = 8;}}} if (v7place[8] == 1) { if (v7place[5] == 1) { if (v7place[2] == 0) { v7step1PC = 2;}}} if (v7place[2] == 1) { if (v7place[8] == 1) { if (v7place[5] == 0) { v7step1PC = 5;}}} if (v7place[0] == 1) { if (v7place[4] == 1) { if (v7place[8] == 0) { v7step1PC = 8;}}} if (v7place[8] == 1) { if (v7place[4] == 1) { if (v7place[0] == 0) { v7step1PC = 0;}}} if (v7place[0] == 1) { if (v7place[8] == 1) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7place[2] == 1) { if (v7place[4] == 1) { if (v7place[6] == 0) { v7step1PC = 6;}}} if (v7place[6] == 1) { if (v7place[4] == 1) { if (v7place[2] == 0) { v7step1PC = 2;}}} if (v7place[2] == 1) { if (v7place[6] == 1) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7place[0] == 2) { if (v7place[1] == 2) { if (v7place[2] == 0) { v7step1PC = 2;}}} if (v7place[2] == 2) { if (v7place[1] == 2) { if (v7place[0] == 0) { v7step1PC = 0;}}} if (v7place[0] == 2) { if (v7place[2] == 2) { if (v7place[1] == 0) { v7step1PC = 1;}}} if (v7place[3] == 2) { if (v7place[4] == 2) { if (v7place[5] == 0) { v7step1PC = 5;}}} if (v7place[5] == 2) { if (v7place[4] == 2) { if (v7place[3] == 0) { v7step1PC = 3;}}} if (v7place[3] == 2) { if (v7place[5] == 2) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7place[6] == 2) { if (v7place[7] == 2) { if (v7place[8] == 0) { v7step1PC = 8;}}} if (v7place[8] == 2) { if (v7place[7] == 2) { if (v7place[6] == 0) { v7step1PC = 6;}}} if (v7place[6] == 2) { if (v7place[8] == 2) { if (v7place[7] == 0) { v7step1PC = 7;}}} if (v7place[0] == 2) { if (v7place[3] == 2) { if (v7place[6] == 0) { v7step1PC = 6;}}} if (v7place[6] == 2) { if (v7place[3] == 2) { if (v7place[0] == 0) { v7step1PC = 0;}}} if (v7place[0] == 2) { if (v7place[6] == 2) { if (v7place[3] == 0) { v7step1PC = 3;}}} if (v7place[1] == 2) { if (v7place[4] == 2) { if (v7place[7] == 0) { v7step1PC = 7;}}} if (v7place[7] == 2) { if (v7place[4] == 2) { if (v7place[1] == 0) { v7step1PC = 1;}}} if (v7place[1] == 2) { if (v7place[7] == 2) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7place[2] == 2) { if (v7place[5] == 2) { if (v7place[8] == 0) { v7step1PC = 8;}}} if (v7place[8] == 2) { if (v7place[5] == 2) { if (v7place[2] == 0) { v7step1PC = 2;}}} if (v7place[2] == 2) { if (v7place[8] == 2) { if (v7place[5] == 0) { v7step1PC = 5;}}} if (v7place[0] == 2) { if (v7place[4] == 2) { if (v7place[8] == 0) { v7step1PC = 8;}}} if (v7place[8] == 2) { if (v7place[4] == 2) { if (v7place[0] == 0) { v7step1PC = 0;}}} if (v7place[0] == 2) { if (v7place[8] == 2) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7place[2] == 2) { if (v7place[4] == 2) { if (v7place[6] == 0) { v7step1PC = 6;}}} if (v7place[6] == 2) { if (v7place[4] == 2) { if (v7place[2] == 0) { v7step1PC = 2;}}} if (v7place[2] == 2) { if (v7place[6] == 2) { if (v7place[4] == 0) { v7step1PC = 4;}}} if (v7step1PC == 9) { v7step1PC = v7getRandomInt(0, 9); while (v7place[v7step1PC]!=0) { v7step1PC = v7getRandomInt(0, 9);} } v7place[v7step1PC] = 2; } } function v7getRandomInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } function v7NewClick() { v7colstep = -1; v7place = [0, 0, 0, 0, 0, 0, 0, 0, 0]; v7NumberStep = 0; document.getElementById('v7image0').style.border = "2px solid white"; document.getElementById('v7image1').style.border = "2px solid white"; document.getElementById('v7image2').style.border = "2px solid white"; document.getElementById('v7image3').style.border = "2px solid white"; document.getElementById('v7image4').style.border = "2px solid white"; document.getElementById('v7image5').style.border = "2px solid white"; document.getElementById('v7image6').style.border = "2px solid white"; document.getElementById('v7image7').style.border = "2px solid white"; document.getElementById('v7image8').style.border = "2px solid white"; v7GoDraw(); } </script>