Sha256: 1fe32643cd4757aca8f22b1491cb6e3fb8ebca250550a4a83a46ec7a5c236a06
Contents?: true
Size: 646 Bytes
Versions: 11
Compression:
Stored size: 646 Bytes
Contents
# frozen_string_literal: true module Codebreaker class Difficulties LEVELS = { easy: { attempts: 15, hints: 2 }, medium: { attempts: 10, hints: 2 }, hell: { attempts: 5, hints: 1 } }.freeze attr_reader :level, :attempts, :hints def initialize(difficulties) @level = difficulties @attempts = LEVELS[difficulties.to_sym][:attempts] @hints = LEVELS[difficulties.to_sym][:hints] end class << self def valid_difficult(difficulties) Verifier.verify_valid_difficult(difficulties) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems