tag:blogger.com,1999:blog-13751027.post2865328000111540015..comments2024-01-10T19:56:04.278-08:00Comments on What do you want to program today?: PuzzleBlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-13751027.post-68841821548955186322008-01-30T20:10:00.000-08:002008-01-30T20:10:00.000-08:00In F#:----------------------#lightlet rec assignDo...In F#:<BR/>----------------------<BR/>#light<BR/>let rec assignDocIndex i docs existing = match docs with | [] -> [] | x::xs -> match existing with | y :: ys when y=i -> assignDocIndex y (i+1) xs ys | _ -> i :: assignDocIndex (i+1) xs existing<BR/>----------------------<BR/>> // usage<BR/>- assignDocIndex 0 docs [1;3;8];;<BR/>----------------------<BR/><BR/>The code would look much nicer if I could format it in this comment.Anonymousnoreply@blogger.com