Sha256: 1e0eca2499ef51599b5f4d389dc93e3cccd9f979e843645a0ad835c3c0454e9a
Contents?: true
Size: 358 Bytes
Versions: 3
Compression:
Stored size: 358 Bytes
Contents
module GuessWho module Comparator 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 end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
guess_who-0.1.2 | lib/guess_who/comparator.rb |
guess_who-0.1.1 | lib/guess_who/comparator.rb |
guess_who-0.1.0 | lib/guess_who/comparator.rb |