Tic Tac Blah

ftfish
Posts: 12
Joined: Thu Aug 20, 2009 1:51 am

Post by ftfish »

to the confused ones:
when someone wins, all the succeeding moves should be ignored.
hhanger
Posts: 3
Joined: Sat Sep 05, 2009 2:52 am

Post by hhanger »

Still confused... :( Tried many answers, all are wrong...
bearson
Posts: 6
Joined: Thu Sep 10, 2009 8:43 am

Post by bearson »

hhanger wrote:Still confused... :( Tried many answers, all are wrong...
patpat...

Some hint :p
There are 2 players play this game in turn and only wines or draws count.
murphy
Posts: 1
Joined: Sun Sep 06, 2009 11:11 am

Post by murphy »

hhanger wrote:Still confused... :( Tried many answers, all are wrong...
patpat
zael
Posts: 4
Joined: Tue Sep 29, 2009 9:13 am

Post by zael »

Since one space on the 9 space board is always taken by a 'O', there are 8 spaces to play, starting with 'X' taking the first turn.

Due to there being 8 spaces and each space either being taken by 'X' or 'O', I decided to represent entire games as one byte, with equal numbers of zeroes and ones (because each player takes 4 turns).

Since I don't want to spoil things I'll stop there. But I haven't found the answer with my method. I've tried accounting for reflections and also 'X' taking the center space in a second set of games, but still no dice. So I assume my methodology is flawed. But it looks right to me.

If someone who has solved it could just tell me if I'm wrong, then I'll approach it from a different angle. Otherwise I think I'm right and just have a bug in my approach.

I am bad at basically every aspect of maths :/
Also if this is considered saying too much then by all means delete this post.
Karian
Posts: 75
Joined: Wed Jan 09, 2008 10:21 am

Post by Karian »

zael wrote:Due to there being 8 spaces and each space either being taken by 'X' or 'O', I decided to represent entire games as one byte, with equal numbers of zeroes and ones (because each player takes 4 turns).
The fact that every player takes 4 turns is isn't really true. Games can be over before all players have taken 4 turns. Once a player has 3 in a row, the game finishes.
zael
Posts: 4
Joined: Tue Sep 29, 2009 9:13 am

Post by zael »

I forgot to mention that I was checking for a win after each turn. Thanks anyway.. it's probably my method that's wrong. It seemed right though :)
DaymItzJack
Posts: 106
Joined: Thu Oct 29, 2009 9:21 pm

Post by DaymItzJack »

So what is the possibility that if I just make a program to randomly play games (and I count the draws) it'd give me the correct answer? I'm assuming since it's to 8 decimal places it'd take a lot of games to be accurate.

I got a question:

If these are the two boards:

O | O | X
X | X | X
O | X | O

O | O | X
X | X | X
X | O | O

And the person with X's wins at the very beginning, does this count as two games and two games won?
Karian
Posts: 75
Joined: Wed Jan 09, 2008 10:21 am

Post by Karian »

the second board you are giving can never be a valid end of the game. In this board, X is winning in 2 different ways. the game should have stopped after X has made the winning move.
DaymItzJack
Posts: 106
Joined: Thu Oct 29, 2009 9:21 pm

Post by DaymItzJack »

Karian wrote:the second board you are giving can never be a valid end of the game. In this board, X is winning in 2 different ways. the game should have stopped after X has made the winning move.
I was trying to say that if this occurred:

O | |
X | X | X
O | |

Is that only one win or do I count all the extra moves after as a possible win as well?
User avatar
CodeX
Posts: 350
Joined: Fri Oct 17, 2008 5:28 pm

Post by CodeX »

I would assume not as they aren't really possible moves as the game would have ended and so no more moves are valid
User avatar
Isaev
Posts: 39
Joined: Tue Dec 16, 2008 11:23 pm
Location: Germany

Post by Isaev »

Does this count as two games won or as one game won?

Image
Karian
Posts: 75
Joined: Wed Jan 09, 2008 10:21 am

Post by Karian »

Isaev wrote:Does this count as two games won or as one game won?
2 games
User avatar
vjeetje
Posts: 2
Joined: Thu Apr 15, 2010 10:02 am
Location: Belgium

Post by vjeetje »

I found the solution, but I am still confused whether the solution is actually correct. Plus the description of the challenge made me really confused. I didn't found it necessary to start a solved topic for this challenge.

The first player plays with circles(0) and the opponent plays with crosses(X). The board will have 8 free places which is indicated below.

1 | 2 | 3
4 | 0 | 5
6 | 7 | 8

now if the match is as following: 12345687. The number indicates the place where the X's and 0's are placed. So the first player plays a O at the centre, next the opponent plays a X at location 1, the first plays a 0 at location 2,... after 8 (including the opening move) moves we have the current situation:

X | O | X
O | O | X
O | | X

this means the game is over, the opponent won. But the description states the opponent can't win, because placing the first move at the centre is a sure way to win. In the real world this would of course not happen, because the first player could easily block the 3 X's and make a draw of the situation. Judging from the program I wrote this situation is placed in the category of draws. But I didn't found that to be according to the given task.
Karian
Posts: 75
Joined: Wed Jan 09, 2008 10:21 am

Post by Karian »

vjeetje wrote:this means the game is over, the opponent won. But the description states the opponent can't win, because placing the first move at the centre is a sure way to win. In the real world this would of course not happen, because the first player could easily block the 3 X's and make a draw of the situation. Judging from the program I wrote this situation is placed in the category of draws. But I didn't found that to be according to the given task.
The description states that if you play intelligently, it is a sure win/draw. It is just an introduction to the problem, an explanation why the first move is in the center.
The problem resolves around random games after this point. Surely, in a random match, the second player still has a chance, so there is no reason to count this as a draw.
Post Reply