Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Fix my code?

Author
Message
Radio Check
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location:
Posted: 13th Oct 2004 00:18
I have a little TicTacToe game that I have been working on to practice with functions, but I can't find one little problem that has me completely stopped. For some reason, you have to click on one more tile after you win before it will register a win. I would have been done with this a month ago if I could find the problem. As far as I can see it should work.

There are some extra things that I have commented out that were attempts to find the problem. It should run in DBC without any extras.

Thanks!

Making a cool sig is just too much pressure for me right now.
PoHa!84
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 13th Oct 2004 00:34 Edited at: 13th Oct 2004 00:38
Hiya there! I'll look at your code and see if I can find anything. It may take a little while though...

Hmm... didn't take long at all...

put this line at the start of the CheckWinner() function, and it works, although it doesn't color the winning cube:





something
Radio Check
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location:
Posted: 13th Oct 2004 01:32
Well that works....

Hah! I see it now. It was changing players before it checked for a winner. Your code made it check the _last_ player for a win.

So I moved the CheckWinner() call inside the SelectCube() function, after the mouseclick() but before ChangePlayer(). Now it checks for a winner _before_ it changes players.

But, it still doesn't color the cube... Hmmm...

Anyway, Thanks! I knew it was just me not being able to see it.

Making a cool sig is just too much pressure for me right now.

Login to post a reply

Server time is: 2024-09-23 02:24:51
Your offset time is: 2024-09-23 02:24:51