module GuessWhoNoFuzzy::Comparator

Public Class Methods

better?(contender, best, contender_length, best_length) click to toggle source
# File lib/guess_who_no_fuzzy/comparator.rb, line 3
def self.better?(contender, best, contender_length, best_length)
  if contender >= best
    if contender == best # if the same score, go with simpler option
      contender_length <= best_length
    else # if not the same score, we have a winner!
      true
    end
  end
end