Esempio n. 1
0
 public static function processaJogada($jogador, $jogada)
 {
     self::$_vezJogador = $jogador === "X" ? "O" : "X";
     for ($i = 0; $i < 3; $i++) {
         for ($j = 0; $j < 3; $j++) {
             self::$_matrizJogoVelha[$i][$j] = $jogada["hdnMatrizVelha{$i}{$j}"];
             if ($jogada["chkMatriz{$i}{$j}"] != "") {
                 self::$_matrizJogoVelha[$i][$j] = $jogada["chkMatriz{$i}{$j}"];
             }
         }
     }
 }
Esempio n. 2
0
    <head>
        <meta charset="UTF-8">
        <title>Jogo da Velha</title>
        <style>
            .colunaVelha {
                font: bold 16px Verdana, Arial;
                height:35px;
                width:35px;
            }
            .blue {
                color:blue;
            }
            .red {
                color:red;
            }
        </style>
    </head>
    <body>
        <h1>Jogo da Velha</h1>
        <form method="post" action="">
        <?php 
$jogo = new Velha(3, 3);
?>
        <hr>
        <?php 
echo $jogo->Resultado();
?>
        </form>
    </body>
</html>