wordle_decoder 0.1.3 → 0.1.4
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/.rubocop.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/Rakefile +2 -2
- data/bin/wordle_decoder +1 -1
- data/lib/wordle_decoder/version.rb +1 -1
- data/lib/wordle_decoder/word.rb +1 -1
- data/lib/wordle_decoder/word_search.rb +1 -1
- data/lib/wordle_decoder/wordle_share.rb +7 -2
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b287c675238c8e02b76dd2fcb7c6811837831e2245954a9465a2f1d6634ecb5
|
|
4
|
+
data.tar.gz: 1d0f11cdd67b6443ebc6362daf666e82006c361b23a9847ee8c1a3020eeea1ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4dcdc6aa0b31fd576fc973bd35ff7681ae4e054009d62f81afa00a25088e06e81e4c128068de5c524d4e30668b49bd0847e2354f5f614e80fab0e48a7c56c75d
|
|
7
|
+
data.tar.gz: d414927380ff8e1832c7eb70b1e9f632dc41357d586f1f9674cda5f8161e0d6e2c3ff393677b45fab47155d2b56dac1f6edf4a446003da4b4b2fdbf2399af6aa
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
|
@@ -20,7 +20,7 @@ task default: %i[test rubocop]
|
|
|
20
20
|
task :create_word_search_files do
|
|
21
21
|
sorted_words = load_words_sorted_by_frequency
|
|
22
22
|
most_common_words = sorted_words.pop(3_000)
|
|
23
|
-
most_common_words, less_common_words = most_common_words.partition { |r| r.
|
|
23
|
+
most_common_words, less_common_words = most_common_words.partition { |r| r.chars.uniq.count == 5 }
|
|
24
24
|
File.write(lib_path("most_common_words.txt"), most_common_words.join("\n"))
|
|
25
25
|
File.write(lib_path("less_common_words.txt"), less_common_words.join("\n"))
|
|
26
26
|
File.write(lib_path("least_common_words.txt"), sorted_words.join("\n"))
|
|
@@ -29,7 +29,7 @@ end
|
|
|
29
29
|
task :output_most_common_letters do
|
|
30
30
|
words = load_wordle_words("allowed_answers.txt")
|
|
31
31
|
words.concat load_wordle_words("allowed_guesses.txt")
|
|
32
|
-
letter_count_tally = words.flat_map { _1.
|
|
32
|
+
letter_count_tally = words.flat_map { _1.chars }.tally
|
|
33
33
|
letter_count_tally = letter_count_tally.sort_by { -_2 }
|
|
34
34
|
puts letter_count_tally.first(10).map { _1.first }.join(" ")
|
|
35
35
|
end
|
data/bin/wordle_decoder
CHANGED
|
@@ -139,4 +139,4 @@ salutations = ["Maybe some of those are your words!",
|
|
|
139
139
|
"I enjoyed our time together!"].freeze
|
|
140
140
|
|
|
141
141
|
puts CLI::UI.fmt("\n\n #{salutations.sample}\n " \
|
|
142
|
-
|
|
142
|
+
"{{blue:https://github.com/mattruzicka/wordle_decoder}}}}\n\n")
|
data/lib/wordle_decoder/word.rb
CHANGED
|
@@ -62,7 +62,7 @@ class WordleDecoder
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def answer_chars
|
|
65
|
-
@answer_chars ||= answer&.strip&.
|
|
65
|
+
@answer_chars ||= answer&.strip&.chars
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def hint_lines
|
|
@@ -102,11 +102,16 @@ class WordleDecoder
|
|
|
102
102
|
|
|
103
103
|
def parse_wordle_lines!
|
|
104
104
|
input_lines.filter_map do |line|
|
|
105
|
-
line =
|
|
105
|
+
line = normalize_wordle_line(line)
|
|
106
106
|
line if line.each_char.all? { |c| VALID_HINT_CHARS.include?(c) }
|
|
107
107
|
end
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
+
def normalize_wordle_line(line)
|
|
111
|
+
line = translate_emoji_shortcodes(line)
|
|
112
|
+
line.each_grapheme_cluster.map { |cluster| cluster.codepoints.first }.pack("U*")
|
|
113
|
+
end
|
|
114
|
+
|
|
110
115
|
SHORTCODES_TO_EMOJIS = { ":black_large_square:" => "⬛",
|
|
111
116
|
":white_large_square:" => "⬜",
|
|
112
117
|
":large_green_square:" => "🟩",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wordle_decoder
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Ruzicka
|
|
@@ -59,6 +59,7 @@ licenses:
|
|
|
59
59
|
metadata:
|
|
60
60
|
homepage_uri: https://github.com/mattruzicka/wordle_decoder
|
|
61
61
|
source_code_uri: https://github.com/mattruzicka/wordle_decoder
|
|
62
|
+
rubygems_mfa_required: 'true'
|
|
62
63
|
post_install_message:
|
|
63
64
|
rdoc_options: []
|
|
64
65
|
require_paths:
|