Determine win in Tictactoe
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.