Sha256: 047d009e70f7a552b7d111fc7a8429c1cfc44f53182b4fd9b4b5691fc3ff0706
Contents?: true
Size: 540 Bytes
Versions: 1
Compression:
Stored size: 540 Bytes
Contents
# frozen_string_literal: true require_relative "guess_handler" require_relative "homescreen_options" require_relative "user" class Game include GuessHandler include HomescreenOptions attr_reader :secret_code def initialize @secret_code = (1..4).to_a.map { |_num| rand(1..6) } @hint_array = @secret_code.map(&:clone) @num_of_hints = 2 end def give_a_hint if @num_of_hints.zero? puts "No more hints!" return end print @hint_array[0] @hint_array.shift @num_of_hints -= 1 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
codebreaker_kirill-0.2.0 | lib/codebreaker_kirill/game.rb |