Tic Tac Blah
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.
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.
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 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).
-
- Posts: 106
- Joined: Thu Oct 29, 2009 9:21 pm
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?
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?
-
- Posts: 106
- Joined: Thu Oct 29, 2009 9:21 pm
I was trying to say that if this occurred: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.
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?
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.
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.
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.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 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.