Apologies if this has been asked before. I'm trying to make the game mastermind using oop. The aim of the class is to check if two instance variables (a code and a guess) are equal or not. How do I set the instance variables in order to test this? Thanks!
class MastermindCodechecker
def initialize(code, guess)
@code = code
@guess = guess
end
def check?
# return true if @code == @guess
end
end
@code == @guessis what you need (and you already have it). What's the question then?