I don't hate this:

1
2
3
4
5
6
7
8
9
10
11
12
13
 

let oddsAndEvens l =
    let rec loop l b odds evens=
        match l,b with
        | h::t, true -> loop t false (h::odds) evens
        | h::t, false-> loop t true odds (h::evens)
        | [],_ -> List.rev odds, List.rev evens
    loop l true [] []

printfn "%A" (oddsAndEvens [1..11])

By on 5/13/2010 10:23 PM ()

Thank you... [:D]

By on 5/14/2010 7:52 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper