TodorMitev

Page_Load()-edited

May 18th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (ViewState.Count <= 0)
  4.             {
  5.                 InitializeBoard();
  6.                 this.turn = 0;
  7.             }
  8.             if (IsPostBack)
  9.             {
  10.                 this.tictactoe = (Dictionary<int[,], int>)ViewState["tictactoe"];
  11.                 this.board = this.tictactoe.Keys.First();
  12.                 this.turn = this.tictactoe.Values.First();
  13.             }
  14.             if ((this.turn % 2 == 1) || this.turn ==0)
  15.             {
  16.                 ComputerPlay();
  17.             }
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment