lib/codebreaker_first.rb in codebreaker_first-0.5.0 vs lib/codebreaker_first.rb in codebreaker_first-0.6.0
- old
+ new
@@ -1,7 +1,7 @@
require 'json'
-require_relative 'codebreaker_first/version'
+require_relative 'codebreaker_first/version.rb'
module CodebreakerFirst
MAX_TRIES = 6
# Rubocop
@@ -17,10 +17,10 @@
def from_hash(data)
Game.new data['code'], data['user_tries'], data['game_result']
end
def start
- return if code.length
+ return if code.length == 4
4.times do
@code << rand(1...6).to_s
end
end