Jump to content

unbeatable tic tac toe


s0n

Recommended Posts

sorry i didnt know guide lines for posting

here is problem section of code

 

    echo "<form name=tictactoe method=post action=tictactoe.php>";

    echo "<input type=hidden name=play value=".$winner.">";

    echo "<table cellspacing=0 cellpadding=0 border=0 width=300 height=300>";

 

    for($i = 0; $i < count($squares); $i++)

{

        if(($i+1) % 3 == 1)

        echo '<tr>';

        echo '<td>';

        echo "<input value='" .$squares[$i]."'type=button name=move class=table onclick=makeMove('move".$i."')>";

        echo '<input type=hidden name=\'move'.$i.'\' value=\''.$squares[$i].'\'>';

        echo '</td>';

        if(($i+1) % 3 == 0)

            echo '</tr>';

    }

 

echo "</table>";

echo "</form>";

echo "<br>";

echo "<font size=6";

 

that is susposed to generate my table array array 0 -8

im getting an offset error 9 for some reason

Link to comment
https://forums.phpfreaks.com/topic/100419-unbeatable-tic-tac-toe/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.