Computer Science Canada Tic-Tac-Toe |
Author: | myckem [ Tue Jan 24, 2006 5:47 pm ] | ||
Post subject: | Tic-Tac-Toe | ||
I have made a Tic-Tac-Toe program but I must have messed up somewhere since there seems to be a problem. Keep in mind that I just started Turing not long ago ![]() Here is the program. Sorry some stuff are in french ![]()
It's a basic Tic-Tac-Toe game with letters. The game is not done but I am stuck at the end. The if at the end doest work. Thank you for your time ![]() |
Author: | Tupacalypse_Vinsanity [ Tue Jan 24, 2006 6:30 pm ] |
Post subject: | ~ |
Can you try to post an english version? I could try to help if you do. |
Author: | myckem [ Tue Jan 24, 2006 10:23 pm ] | ||
Post subject: | |||
Well here is the new version since I couldnt edit my post
![]() |
Author: | sylvester-27 [ Wed Jan 25, 2006 12:50 pm ] |
Post subject: | |
you should make the program recognize when the user wins...also the is a very...unique way to make tic tac toe. And whats the problem? The program itself works fine. |
Author: | Albrecd [ Wed Jan 25, 2006 1:29 pm ] |
Post subject: | |
If ther is an O on A, you can still put an X on it. |
Author: | myckem [ Wed Jan 25, 2006 10:00 pm ] |
Post subject: | |
The problem is it doesnt recognize when someone wins. And I dont know how to fix the A problem. |
Author: | myckem [ Fri Jan 27, 2006 4:46 pm ] |
Post subject: | |
Nobody can help? ![]() |
Author: | myckem [ Sun Jan 29, 2006 11:50 pm ] |
Post subject: | |
I would appreciate it if someone could tell me where I went wrong or guide in the right direction ![]() |
Author: | Delos [ Mon Jan 30, 2006 11:03 am ] | ||||||||
Post subject: | |||||||||
Ah, mon ami! Une programme en francais, c'est vraiment fraise, bien-sur. Oui, je sais, je sais, mon francais est terrible, mais, on peut essayer un peut, non? La probleme principal, je pense, est ici:
Est-ce que tu peut dire que 'c1'...uh...bah. Yeah, that's not going to work much longer. Ok, as I was saying, are you trying to say that 'c1' ought to increase by one? Because this line sets c1 to 1, as opposed to adding 1 to it.
Would be what you'd need to do. There is a problem though. If you, for instance, echo the contents of position(1)...position(3), you'll notice that they increase over time. I'm not sure if this is intentional, but it nullifies the effect of this statement:
Try it out for yourself. Add these lines to the end of the loop:
If I understand your intent correctly, 'position' will hold all the positions of player 1? And post2 will do the same for player 2? If so, it would simply be easier to use one array, and use an indicator for each block that specifies which player occupies it. For instance, if position (1) were '2' then player 2 would have a piece there. From this you may check which triplets are held by which players. Bon chance! |
Author: | redrenagade [ Sat Feb 11, 2006 12:14 pm ] |
Post subject: | |
try adding a instructions page. Would really help clear up how to play. Figured it out though... |