Tic Tac Toe Game in asp.net

Description:-

in this article we will create tic tac toe game in dot net using css, Markup code and java script. here i have used it to create it and you can play it on your web browser.

Markup code:-

<table width="150px">
  <tr>
    <td>
      <input type="button" id="1" onclick="return Tic(this);" />
    </td>
    <td>
      <input type="button" id="2" onclick="return Tic(this);" />
    </td>
    <td>
      <input type="button" id="3" onclick="return Tic(this);" />
    </td>
  </tr>
  <tr>
    <td>
      <input type="button" id="4" onclick="return Tic(this);" />
    </td>
    <td>
      <input type="button" id="5" onclick="return Tic(this);" />
    </td>
    <td>
      <input type="button" id="6" onclick="return Tic(this);" />
    </td>
  </tr>
  <tr>
    <td>
      <input type="button" id="7" onclick="return Tic(this);" />
    </td>
    <td>
      <input type="button" id="8" onclick="return Tic(this);" />
    </td>
    <td>
      <input type="button" id="9" onclick="return Tic(this);" />
    </td>
  </tr>
</table>
<br />
<input type="button" id="btnPlay" onclick="return Play();" value="Play" 
  style="width:100px; height: 30px; font: verdana 12pt;" />
<asp:HiddenField ID="hfGameOver" runat="server" Value="No" />
<asp:HiddenField ID="hfValue" runat="server" Value="X" />

Style Sheet:-

<style type="text/css">

input
{
  width: 50px;
  height: 50px;
}

.winner
{
  background-color: #FF69B4;
}

</style>

Related Posts

Previous
Next Post »

1 comments:

comments

Thanks for comments.....