generateTree :: Tree -> [Tree]
generateTree n
  | vms == [] = []
  | otherwise = [let nn = Node b m n $ generateTree nn in nn | (m, b) <- nbs]
  where b   = board n
        vms = stripSimilarMoves b $ validMoves b
        nbs = map (\x -> (x, makeMove b x)) vms

-- The root node
generateTree :: Tree -> [Tree]
generateTree n
  | vms == [] = []
  | otherwise = [let nn = Node b m n $ generateTree nn in nn | (m, b) <- nbs]
  where b   = board n
        vms = stripSimilarMoves b $ validMoves b
        nbs = map (\x -> (x, makeMove b x)) vms

-- The root node
generateTree n
  | vms == [] = []
  | otherwise = [let nn = Node b m n $ generateTree nn in nn | (m, b) <- nbs]
  where b   = board n
        vms = stripSimilarMoves b $ validMoves b
        nbs = map (\x -> (x, makeMove b x)) vms

-- The root node