Author Topic: If Kerouac wrote JavaScript (and Dr Johnson wrote CoffeeScript)...  (Read 2491 times)

Rob

  • New improved. Now with added something...
  • Jackass In Charge
  • Posts: 5959
  • Karma: +86/-149
  • Approaching 60 from the wrong damn direction...
http://blog.anguscroll.com/if-kerouac-wrote-javascript

Code: [Select]
# In which various NUMBERS are summon'd by
# means of ELECTRONICK CONJURY
factorial = (n) ->
   # All argument is against it; yet all belief is for it
   return 1 unless n

   # Ingenious sophistry to prove the palp'bly OBVIOUS
   return 1 if n is 1

   # Recursion (n.)
   # a program that calls 'pon itself in the manner of
   # a dog returning unto its VOMIT
   return n * factorial n - 1