Hello,
Newbie question here:
I have written a simple code to test my ruby knowledge. It is as
follows:
--------
class Mastermind
def k(a,b)
v = a+b
put v
end
k(2,3)
end
-----------
When I run the class, I want to see the code return the number 5.
However, when I run the code i get an error saying that the method K is
undefined. What is wrong here?
on 2010-11-15 15:39
on 2010-11-15 15:50
Nevermind - I figured it out. Thanks! Kaustub Samant wrote in post #961568: > Hello, > > Newbie question here: > > I have written a simple code to test my ruby knowledge. It is as > follows: > > -------- > > class Mastermind > > def k(a,b) > v = a+b > put v > end > > k(2,3) > > end > > ----------- > > When I run the class, I want to see the code return the number 5. > However, when I run the code i get an error saying that the method K is > undefined. What is wrong here?
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.