Who won the game?

0

Task

Everyone knows the game "Tic-Tac-Toe". Your task is it, to evaluate an ascii tic-tac-toe matchfield. Your Programm/Function should output/return the winner: O, X or nobody (N).

Pattern

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

In this case your programm/function should output/return 'X'

Rules

  • Input can come from STDIN, function arguments, command line argument, file, whatever suits you.

  • The program can be a function, full program, whatever works, really, as long as no external files are needed to run it.

  • You can assume that the input is valid.

Test Cases

X|O|X
O|X|X  = O
O|O|O

O|X|O
X|X|O  = X
O|X|X

X|O|X
O|X|O  = N
O|X|O

This is , so the shortest answer (in bytes) wins.

Tom291

Posted 2017-03-31T11:15:23.537

Reputation: 313

Question was closed 2017-03-31T11:21:16.623

3The first test case... A GLIDER? – Matthew Roh – 2017-03-31T11:22:24.790

@SIGSEGV Good eye! – Carcigenicate – 2017-03-31T22:19:06.280

No answers