VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Basic Tic-Tac-Toe Game. (Pretty Short Code)

by Steven Hogle-Jones (2 Submissions)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 15th May 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Basic Tic-Tac-Toe Game. (Pretty Short Code)

Rate Basic Tic-Tac-Toe Game. (Pretty Short Code)



   If lblblank(index).caption = "X" or lblblank(index).caption = "O" then
       msgbox"Sorry but this spot is already used.",vbokonly,"Used Spot"
   else
       if lblturn.caption = "X" then
          lblblank(index).caption = "X"
          lblturn.caption = "O"
       else
          lblblank(index).caption = "O"
          lblturn.caption = "X"
       end if
   end if
end sub

private sub cmdclear_click()
   dim lbl as object
   for each lbl in frmtictactoe
      if typeof lbl is label then
         lbl.caption = ""
      end if
   next
   resp = msgbox("Is X going first this time?",vbyesno,"Turn?")
   if resp = 6 then
      lblturn.caption = "X"
   else
      lblturn.caption = "O"
   end if
end sub

Download this snippet    Add to My Saved Code

Basic Tic-Tac-Toe Game. (Pretty Short Code) Comments

No comments have been posted about Basic Tic-Tac-Toe Game. (Pretty Short Code). Why not be the first to post a comment about Basic Tic-Tac-Toe Game. (Pretty Short Code).

Post your comment

Subject:
Message:
0/1000 characters