waylon-wordle 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/data/vocabulary.json +2329 -7207
- data/lib/waylon/wordle/solver.rb +4 -2
- data/lib/waylon/wordle/version.rb +1 -1
- data/lib/waylon/wordle.rb +7 -1
- metadata +2 -2
data/lib/waylon/wordle/solver.rb
CHANGED
@@ -43,9 +43,11 @@ module Waylon
|
|
43
43
|
def find_potential_solution
|
44
44
|
potential_solutions = Waylon::Wordle.vocabulary.map(&:chars).reject { _1.intersect?(misses) }
|
45
45
|
|
46
|
-
potential_solutions.select do |word|
|
46
|
+
candidates = potential_solutions.select do |word|
|
47
47
|
hits_match?(hits, word) && near_hits_match?(near_hits, word)
|
48
|
-
end
|
48
|
+
end
|
49
|
+
|
50
|
+
candidates.shuffle.max_by { _1.uniq.size }
|
49
51
|
end
|
50
52
|
|
51
53
|
def last_attempted_word = attempts.last[:word]
|
data/lib/waylon/wordle.rb
CHANGED
@@ -29,7 +29,13 @@ module Waylon
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.random_startword
|
32
|
-
vocabulary.select
|
32
|
+
vocabulary.select do |word|
|
33
|
+
if rand(10) > 5
|
34
|
+
word.chars.uniq.intersection(%w[a e i o u]).uniq.size >= 4
|
35
|
+
else
|
36
|
+
word.chars.uniq.intersection(%w[a e o s t r n]).uniq.size >= 4
|
37
|
+
end
|
38
|
+
end.sample
|
33
39
|
end
|
34
40
|
|
35
41
|
def self.todays_date
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waylon-wordle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: waylon-core
|