From: Robert Klemme Date: 2012-06-01T20:18:29+09:00 Subject: Re: need help with this On Fri, Jun 1, 2012 at 2:50 AM, Spencer Pottebaum wrote: > This is a homework question and I'm really confused by it: > > the method exp(x,y) is passed two integers and returns x^Y write a > recursive version of exp(s,y) in Ruby. > > this is what I have: > > def exp(x,y) > >  if y = 1 >  return x > > return x * exp(x, y-1) > > is this correct? No, you are missing an "end". ;-) You could also include treatment for y == 0. (Hint: a case block might help.) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/