Junior 4 — Tic Tac Moe!
Griffy was about to finish the elusive A Times B problem, when Timothy Li scoffed at him and challenged him to a blind tic-tac-toe match! Griffy is playing as
O and Timothy is playing as
X. After a sequence of random moves, a 3 by 3 board has been filled with
Xs. Both Timothy and Griffy are stuck trying to get their blindfolds off (can't write a program for that unfortunately), so you decide to determine who wins to avoid 5 hours of blindfold-taking-off.
Note: A player wins if there are 3 of the same character in a row, column or diagonal. A player winning in multiple ways in one game is a valid win.
3 lines, representing a grid.
One line, output the string
Error, redoif both
Tieif neither player wins,
OOX XOX XXO