Skip to content

Instantly share code, notes, and snippets.

@mattn
Created August 26, 2010 00:00
Show Gist options
  • Save mattn/550537 to your computer and use it in GitHub Desktop.
Save mattn/550537 to your computer and use it in GitHub Desktop.
func! s:fact(s)
let s = a:s
let r = 1
while s
let r = r * s
let s = s - 1
endwhile
return r
endfunc
echo s:fact(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment