From: "Dasson, Raghav" Date: 2009-12-16T17:13:51+09:00 Subject: Re: a program error Try to use speed = gets.to_i at line 11 and angle = gets.to_i at line 13 to resolve this. Regards, Raghav -----Original Message----- From: teodorcarstea@yahoo.com [mailto:teodorcarstea@yahoo.com] Sent: Wednesday, December 16, 2009 1:08 PM To: ruby-talk ML Subject: a program error hi, all! my compiler doesn't like the "minus" in line 21, it's like: /home/cristi/NetBeansProjects/RubyApplication3/lib/helic.rb:21: undefined method `-' for "":String (NoMethodError) 1 require "init.rb" 2 3 shots = 3 4 time = 1 5 speed = 0 6 x=y=1 7 while (shots!=0) do 8 #give entry data 9 puts "let's f*ck da su**er!" 10 puts "give speed:" 11 speed = gets 12 puts "give angle:" 13 angle = gets 14 #processing entry data 15 angle=(Math::PI)/180*angle.to_f 16 xspeed=speed*Math.cos(angle) 17 yspeed=speed*Math.sin(angle) 18 #trajectory's loop 19 while (y>0) do 20 x=xspeed*time 21 y=yspeed*time-4.9*time**2 22 time+=0.01 23 24 #puts "x="+x.to_i.to_s+" y="+y.to_i.to_s 25 screen.fill_rect 0, 0, 640, 480, BGCOLOR 26 screen.draw_circle x, y, 5, SHELLCOLOR 27 screen.flip 28 29 end 30 shots-=1 31 puts "shots remaining"+ shots.to_s 32 end help, please. thanks! -- Posted via http://www.ruby-forum.com/.