ADAQUBIC - Ada and TicTacToe
Ada the Ladybug was playing 3D Tic-Tac-Toe against her good friend Velvet Mite Vinit. They were playing on 3x3x3 field. Sadly, Vinit had to go home earlier so the game was left unfinished. Ada wants to know who would win the match (if they both played optimaly). You also know that Ada started.
The first line contains a single integer 1 ≤ T ≤ 1000, number of test-cases.
Each test-case will contain 9 lines with three character each, representing the field ('.' for empty place, 'x' for move of Ada and 'o' for move of Vinit). You are assured that the game is unfinished and valid.
First three lines represent the top field, the next three lines represent middle field and the last three lines represent the bottom field.
There will be a blank line before each test-case.
For each test-case, print the name of winner (Ada or Vinit);
7 ..o o.x xox x.x ... x.o ... o.o .x. .x. ... ..o o.x x.. ..o ..x ... ... o.. ... o.x .x. ... .x. o.o .xx oox ..x ..x .o. ..x ..x xo. o.. ..o ... ... ..x ..x .o. ..x o.. ... ... x.o ... ..x ..o ... ... xo. ox. ... .ox o.. x.. ... oxx ..o .ox ..o .x. .x.
Vinit Vinit Ada Vinit Ada Vinit Vinit
Example Input 2
1 xox x.o oox o.o x.x xxo x.o oxo ox.
Example Output 2
@morass: hmm... thanks for the brief explanation man.. hahaha it is really helpful :D
@stcsteven: This one?
@morass: Woww. Thank you for the clarification hahaha... I was wandering if thy code really make it, but I guess my logic takes too long :/ . My basic idea is that making in 2d before expanding to 3d tic tac toe.
@stcsteven: Good day to you,
Can you explain about the winning condition in this 3x3x3 tic tac toe game?