Sha256: ce9845a506221860f216deb063b1cc48a711d0521436770346c69216557d1059

Contents?: true

Size: 376 Bytes

Versions: 2

Compression:

Stored size: 376 Bytes

Contents

module MM
  class SecretCode
    def self.generate(io_helpers, is_code_guesser_human)
      if is_code_guesser_human
        set_secret_code
      else
        io_helpers.get_secret_code_from_user
      end
    end

    def self.set_secret_code
      secret_code = []
      4.times do
        secret_code.push((1..6).to_a.sample)
      end
      secret_code
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
games_bfox-0.6.0 lib/games/mastermind/secret_code.rb
games_bfox-0.4.0 lib/games/mastermind/secret_code.rb