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?
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?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.