From: "Carina C. Zona" Date: 2011-10-05T08:30:15+09:00 Subject: Re: question about method You want 'puts' not 'print' On Tue, Oct 4, 2011 at 4:16 PM, Joseph S. wrote: > AC = 14 > > def roll_d20 >  1 + rand(20) > end > > def attack_roll >  if roll_d20 > AC >    print "Attack roll is #{roll_d20} vs. AC #{AC}. Hit!" >  else roll_d20 <= AC >    print "Attack roll is #{roll_d20} vs. AC #{AC}. Miss!" >  end > end > > 10.times do print attack_roll end > > i want to use the result of roll_d20 and compare it to the value AC but > it doesn't print the correct Hit! or Miss! what am i doing wrong? > > -- > Posted via http://www.ruby-forum.com/. > > --   Carina