Slipkorn

algo

Apr 30th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun :: Integer -> [Integer]
  2. fun x = x:(fun.unirnumeros)[ fromIntegral((length y)*10) + head y| y<-(group.numeroalista) x]
  3.  
  4. numeroalista 0 = []
  5. numeroalista x = numeroalista (div x 10) ++ [mod x 10]
  6.  
  7. unirnumeros:: [Integer]->Integer
  8. unirnumeros x = (modbase.concat) [(cam.numeroalista) n|n<-x]
  9.             where
  10.             modbase (x:[]) = x
  11.             modbase (x:y) = x * (fromIntegral(10^(length y))) + (unirnumeros y)
  12.             cam [] = [0]
  13.             cam x = x
Advertisement
Add Comment
Please, Sign In to add comment