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)
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