MegaDaffy
03-11-2008, 12:01 PM
Hello! I'm almost finished with my "Tic-Tac-Toe" program, however I keep entering an infinite loop when it's the computer's turn.
My question is there a way to set the Parameters and Variables to integers?
Thank You For Your Time!:)
Lprsti99
03-11-2008, 12:22 PM
Not quite sure what you're asking. Mind posting the program? Might give me a better understanding of what you're having a problem with.
DickBaldwin
03-11-2008, 12:37 PM
Hello! I'm almost finished with my "Tic-Tac-Toe" program, however I keep entering an infinite loop when it's the computer's turn.
My question is there a way to set the Parameters and Variables to integers?
Thank You For Your Time!:)
Go to Google and search for the following keywords:
alice integer type site:www.alice.org
I believe that you will find the answer to your question there.
If you don't find it there, go to Google and search for the following keywords:
alice integer type site:www.dickbaldwin.com
I'm reasonably sure that you will find the answer to your question there.
Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
MegaDaffy
03-12-2008, 08:15 PM
Not quite sure what you're asking. Mind posting the program? Might give me a better understanding of what you're having a problem with.
Sure! Here You Go!:)
Lprsti99
03-13-2008, 11:34 AM
Ok, wow... Right off the bat, I suggest you set up the x's and o's so that they are in the corresponding spots (like x1, o1, and 1 are in the same square) Will post more once I get a better look
EDIT: Hmmm, well, for some reason your while loop is not changing your Spot Available variable. you are getting the random numbers fine, but it's as if the if/else statements are not even running. I've tried replacing some of your statements with object and world variables, but to no avail. I tried making new methods with parameters to check if a spot was available and tried using events, as well. What's frustrating is, as far as I can tell, the code should work, even as you had it, but it doesn't. This might be one of the bugs that Alice 2 has, in which case, you might be out of luck. It'd be good for DrJim or DickBaldwin to look at the program, though, as they have more expertise than I do. Otherwise, though, you might consider setting the program up as a two player game, as opposed to a game vs a computer (besides, the computer randomly picking a spot wouldn't be hard to beat.)
Sorry I couldn't be of more help. If I think of anything else, I'll post it.