Class: CodebreakerSmn::CodeHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/codebreaker_smn/helpers/code_handler.rb

Class Method Summary collapse

Class Method Details

.process_guess(code, input) {|result| ... } ⇒ Object

Yields:

  • (result)


5
6
7
8
9
10
11
12
13
14
# File 'lib/codebreaker_smn/helpers/code_handler.rb', line 5

def self.process_guess(code, input)
  temp_code = code.clone
  input = input.split('').map(&:to_i)

  result = plus(temp_code, input) + minus(temp_code, input)

  yield(result)

  result
end