wordle_decoder 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b40e0ae56b3869e0f27bf32298adfb5b147dd120e995f5c288e4dbd58dfbf9e
4
- data.tar.gz: 524a6be77dfe9dce95dd8a19be2d38c6e91d9f07bfc91edc533476d3e9833125
3
+ metadata.gz: 19def1e6b5fe6f2513d21327fd4862c0a4e3db8d01775463633f9bd2eec03dd0
4
+ data.tar.gz: 9a6e2f43a258eb186359491e5090f811ab27792cc945a93eca0ab5b714080af8
5
5
  SHA512:
6
- metadata.gz: ca79c1d211eaf24132b951308df2c1a3c0c54e049dccfab634765835209dc8e391a81957c7832c2d415ab30801d953351d76f927718cd37eeb0c9c3e314469db
7
- data.tar.gz: f5de50d444c980acec3478352ad3944ca03139f3a4247de7de172c932db43689cc82ebd6650bf6c05a2d1123277532c0f352aa13d040e7de4b8064a279e32a18
6
+ metadata.gz: 0de9cbfba9ec0edaca95e4259e21efc79566979e9874841e4c1bd7a9f4462e60a41db6bf4881f15baca5d466b66a0043f74dcad2b2f2b2815b0c07f43373fc49
7
+ data.tar.gz: 378f8d47d3b8a1043c197e3feb1652fdb8398102b51bfb690788a70cad7a1a2f3cccdfe12fcbd5b8051e39c52ff3a6bad1c632e98bf0579309ae3c93dd5d2305
data/LICENSE.md ADDED
@@ -0,0 +1 @@
1
+ https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "wordle_decoder"
6
+
7
+ require "cli/ui"
8
+
9
+ CLI::UI::StdoutRouter.enable
10
+
11
+ print CLI::UI.fmt("\n\n Share your Wordle:\n\n {{blue:>}} ")
12
+
13
+ input_lines = []
14
+ until WordleDecoder::WordleShare.final_line?(input_line = gets)
15
+ input_lines << input_line
16
+ end
17
+ input_lines << input_line
18
+
19
+ clear_pasted_text_lines = input_lines.reverse_each.map { |line| "\033[A\r #{" " * line.length}" }
20
+ clear_pasted_text_lines << "\033[A\r"
21
+ puts clear_pasted_text_lines.join
22
+
23
+ wordle_share = WordleDecoder::WordleShare.new(input_lines)
24
+ puts CLI::UI.fmt(wordle_share.to_terminal)
25
+ puts "\n\n"
26
+
27
+ if wordle_share.find_answer
28
+ answer_confirmed = CLI::UI::Prompt.confirm("\r Is \"{{green:#{wordle_share.answer}}}\" the word of the day?")
29
+ unless answer_confirmed
30
+ wordle_share.answer = nil
31
+ puts "\n"
32
+ end
33
+ end
34
+
35
+ wordle_share.answer_input = CLI::UI.ask("\r What was the word of the day?") until wordle_share.answer
36
+
37
+ puts "\n\n"
38
+
39
+ decoder = wordle_share.decoder
40
+
41
+ CLI::UI::Spinner.spin("Acting like I'm doing something.") do |spinner|
42
+ ellipsis_cycle = %w[.. ... .].cycle
43
+ stop_acting_at = Time.now.utc + 2
44
+ until Time.now.utc > stop_acting_at
45
+ sleep 0.3
46
+ spinner.update_title("Acting like I'm doing something#{ellipsis_cycle.next}")
47
+ end
48
+ spinner.update_title("Fine, I'll do it")
49
+
50
+ decoder.to_terminal
51
+ spinner.update_title("\r I decoded your hints!}}")
52
+ end
53
+
54
+ puts CLI::UI.fmt("\n\n {{blue:{{underline:Guesses}} {{underline:Confidence}}}}")
55
+ puts CLI::UI.fmt(decoder.to_terminal)
56
+
57
+ comments = ["Maybe some of those are your words!",
58
+ "I tried!",
59
+ "How'd I do?",
60
+ "Did I get it?",
61
+ "I'm also guessing you're great!",
62
+ "Don't spill your coffee.",
63
+ "Shout out to friends for sending me their wordles.",
64
+ "Shout out to https://www.youtube.com/watch?v=v68zYyaEmEA for word frequency source.",
65
+ "I hope you had a great time.",
66
+ "Hope to see you again.",
67
+ "Was great guessing you.",
68
+ "Thinking about heading to sleep.",
69
+ "Sometimes I just throw out mostly random stuff.",
70
+ "I didn't mean to offend.",
71
+ "I try not to be random...",
72
+ "I'm open source :)",
73
+ "I'd fork you to make me better.",
74
+ "TLDR: Another programmer played wordle.",
75
+ "How was I with my words?",
76
+ "I'm written in Ruby and bite like a python.",
77
+ "Here's an emoji ❤️",
78
+ "🤔 🤨 🧐",
79
+ "All my thinking to you.",
80
+ "I've learned about wordle and your people.",
81
+ "I'm not learning anything at the moment.",
82
+ "I wish I had time to machine learn you ;)",
83
+ "No, you have a great personality!",
84
+ "This one might be weird, if it's your first.",
85
+ "Is my strategy as good as yours?",
86
+ "I'm biased, but so are you!",
87
+ "I'd love to learn your strategy ;)",
88
+ "I'd grow neurons for you.",
89
+ "How well can you play without me guessing?",
90
+ "If you're seeing this, we probably know each other.",
91
+ "I hope things aren't getting too weird.",
92
+ "❤️ ❤️ ❤️",
93
+ "No, you're great!",
94
+ "Do you decode often?",
95
+ "All the best five-letter words to you!",
96
+ "My friends call me the wordle decoder.",
97
+ "Everything I am is written.",
98
+ "May my written code speak truly.",
99
+ "Who guessed better?",
100
+ "No excuse, but my thoughts are in a constant array.",
101
+ "Your words complete me.",
102
+ "Like peering into a soul.",
103
+ "I hope I didn't embarass myself.",
104
+ "I hope I didn't embarrass myself.",
105
+ "I hope I didn't embaras myself.",
106
+ "Can you decode my five letter word?",
107
+ "Sometimes I'm off by one...",
108
+ "Something's fishy...",
109
+ "Did you put something on me?",
110
+ "I'm only wrong about five letter words...",
111
+ "Your words are beautiful.",
112
+ "You make this wordle a better place!",
113
+ "What in the wordle was I thinking?",
114
+ "Those words you gave me were so good.",
115
+ "I truly enjoyed those words, thank you!",
116
+ "What lovely words you have!",
117
+ "I hope my words were as good as yours!",
118
+ "Please enjoy the rest of your day!",
119
+ "I may not be positive about your words, but I am about you!",
120
+ "Thank you for spending time with me!",
121
+ "I enjoyed our time together!"].freeze
122
+
123
+ puts CLI::UI.fmt("\n #{comments.sample}\n " \
124
+ "{{blue:https://github.com/mattruzicka/wordle_decoder}}}}\n\n")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class WordleDecoder
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordle_decoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Ruzicka
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-04 00:00:00.000000000 Z
11
+ date: 2022-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cli-ui
@@ -27,7 +27,8 @@ dependencies:
27
27
  description: Given your Wordle share text, with some degree of confidence, the decoder
28
28
  will spit back the five-letter words it thinks you played.
29
29
  email:
30
- executables: []
30
+ executables:
31
+ - wordle_decoder
31
32
  extensions: []
32
33
  extra_rdoc_files: []
33
34
  files:
@@ -35,8 +36,10 @@ files:
35
36
  - CHANGELOG.md
36
37
  - Gemfile
37
38
  - Gemfile.lock
39
+ - LICENSE.md
38
40
  - README.md
39
41
  - Rakefile
42
+ - bin/wordle_decoder
40
43
  - lib/least_common_words.txt
41
44
  - lib/less_common_words.txt
42
45
  - lib/most_common_words.txt