Skip to content

Instantly share code, notes, and snippets.

@aktowns
Created November 19, 2010 12:27
Show Gist options
  • Save aktowns/706459 to your computer and use it in GitHub Desktop.
Save aktowns/706459 to your computer and use it in GitHub Desktop.
let rec omNoms start op from nto =
if from > nto then start
else op from (omNoms start op (from + 1) nto)
printfn "%d" (omNoms 0 (+) 1 100)
@aktowns
Copy link
Author

aktowns commented Nov 19, 2010

def omNoms start, op, from, nto  
   return start if from > nto  
   op.call(from, (omNoms start op (from + 1) nto)  
end  

puts  omNoms(0, lambda{|x,y|x+y}, 1, 100)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment