lib/mastermind/knuth.rb
# 3. Remove from S any code that would not give the same response if the guess were the code.
3. Remove from S any code that would not give the same response if the guess were the code.
3 . Remove from S any code that would not give the same response if the guess were the code .
def prune(turn)
      @set.select! do |code|
        !(turn.guess == code) &&
        turn.exact   == code.exact_matches_with(turn.guess) &&
        turn.partial == code.partial_matches_with(turn.guess)
      end
      @possible_guesses.reject! { |guess| turn.guess == guess }
    end
def prune ( turn ) @set . select! do | code | ! ( turn . guess == code ) && turn . exact == code . exact_matches_with ( turn . guess ) && turn . partial == code . partial_matches_with ( turn . guess ) end @possible_guesses . reject! { | guess | turn . guess == guess } end
3.
3 .
turn
<not_specific>