Sha256: f5e6e2204e2ba0e01e6a9d386d09d3ab782cfdfd8d5c43072a0381e27b0bb691

Contents?: true

Size: 449 Bytes

Versions: 1

Compression:

Stored size: 449 Bytes

Contents

require 'letter_press_is_not_as_good_as_boggle'

words = LetterPressIsNotAsGoodAsBoggle do
  board %w[n x g k o e e s i s v a j f e m l r g f z i a j b]

  guessed %w[averages vagaries lovemaking maligners remixing reimagines generalissimo fragile]
end

def score(word, targets)
  (targets - word.chars.to_a).size
end

preferred_chars = %w[g f]

words.sort_by { |word| [-score(word, preferred_chars), word.size] }
     .each    { |word| puts word }

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
letter_press_is_not_as_good_as_boggle-1.0.2 example.rb