Determine win in Tictactoe Let's play some code golf!
Given a tic-tac-toe board state (Example:)
|x|x|o|
|x|o|x|
|o|o|x|

Determine whether a game is a win a lose or cat. Your code should output any of these options given a state. The above game should output lose
Just to be clear: a win is defined as any 3 xs in a row (diagonal, horizontal, vertical). a lose is 3 os in a row, while a cat game in none in a row.
To make things interesting, you get to determine your input structure for the state- which you must then explain. For instance xxoxoxoox is a valid state as seen above where each of the characters is read from left to right, top to bottom. [['x','x','o'],['x','o','x'],['o','o','x']] is the game in multidimensional array read in a similar way. While 0x1a9 which is hex for 110101001 might work as a suitable compression where 1 can be manipulated for xs and 0 can be manipulated for o.
But those are just some ideas, I'm sure you might have many of your own.
Ground rules:

Your program must be able to accept any viable state.
The form of input must be able to represent any state.
The input cannot be redundant, meaning each cell must only appear in one location.
&quot;The win state must be determined from the board&quot;
Assume a complete board
Win before lose for instance in the case 'xxxoooxxx'

Lowest character count wins
Ruby 2.0, 85 characters

Here's a simple bitmask-based solution in Ruby:

d=gets.hex
$&gt;&lt;&lt;[292,146,73,448,56,7,273,84].map{|m|d&amp;m&lt;1?:lose:d&amp;m&lt;m ?:cat: :win}.max


The board is represented as a hex number, made up of nine bits corresponding to the nine squares.  1 is an X, 0 is an O.  This is just like the 0x1a9 example in the question, though the 0x is optional!

There's probably a better way to do the bitmasks then just hardcoding a big list.  I'll happily take suggestions.

See it running on Ideone here.