Haskell, Genetic Algorithm, Graph Theory, Programming.
<- [N .. NW] ] where trailNum trails d = case [i | (t, i) <- zip trails [0 .. 3], d `elem` t] of [i] -> i _ -> error "Duplicate or missing dir on tile" encodeTiles :: [Tile] -> [Bool] encodeTiles = concat . map encodeTile The encodeBinary function is part of moo, and just encodes a binary number