Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Please help, need within next half hour (http://www.programmingforums.org/showthread.php?t=7023)

JDS Nov 16th, 2005 9:55 AM

Please help, need within next half hour
 
I'm programming a VB tic tac toe game. for the board I have 9 image controls
named tictactoe(Index). and two picture controls (one X one O) called Sign(0), and Sign(1) (0 is X). I drag and drop the Sign controls onto the tictactoe one and everything works fine. What I need help on is determining the winner of the game. Right now all I know is how to:

For Index = 0 to 2
if tictactoe(Index).picture = Sign(0).picture Then
Winner = "X"
cmdnew_click
end if
Next

Naturally though using this code whenever I put down an X on the top row, it immediatly says X is the winner and ends the game. How do I make it so the ENTIRE top row has to be X before this code executes?

Thx

Kilo Nov 19th, 2005 10:32 AM

Quote:

Originally Posted by JDS
I'm programming a VB tic tac toe game. for the board I have 9 image controls
named tictactoe(Index). and two picture controls (one X one O) called Sign(0), and Sign(1) (0 is X). I drag and drop the Sign controls onto the tictactoe one and everything works fine. What I need help on is determining the winner of the game. Right now all I know is how to:

For Index = 0 to 2
if tictactoe(Index).picture = Sign(0).picture Then
Winner = "X"
cmdnew_click
end if
Next

Naturally though using this code whenever I put down an X on the top row, it immediatly says X is the winner and ends the game. How do I make it so the ENTIRE top row has to be X before this code executes?

Thx


Post the code you have so far... but it sounds like it you main game loop you need to add a "CheckRows" function call after player turn...

DaWei Nov 19th, 2005 10:47 AM

Quote:

Please help, need within next half hour
:rolleyes:

13EN Nov 20th, 2005 3:10 PM

hi please can you send me that tictactoe game on ben@inbox.karoo.co.uk please


All times are GMT -5. The time now is 10:57 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC