Mastermind implementation to ruby