Advertisement
jack93

F# - List with n chars

Jun 9th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.15 KB | None | 0 0
  1. let rec magicFunc (elements: int, ch: char) =
  2.     if(elements <> 0) then ((magicFunc(elements-1, ch)) @ [ch]) else []
  3.  
  4. printf "%A" (magicFunc(2, 'a'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement