daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env ruby
  2. require 'rubygems'
  3. require 'ruby-debug'
  4. Debugger.start
  5.  
  6. def pow(x, n)
  7.   debugger if n == 1 # start debugger when n == 1
  8.   raise if n < 0
  9.   if n == 0
  10.     return 1
  11.   else
  12.     return pow(x, n - 1) * x
  13.   end
  14. end
  15.  
  16. puts pow(ARGV[0].to_i, ARGV[1].to_i)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top