wordle 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +10 -1
- data/README.md +4 -1
- data/lib/wordle/guess_analyzer.rb +15 -8
- data/lib/wordle/version.rb +1 -1
- data/wordle.gemspec +1 -0
- metadata +17 -4
- data/sig/wordle.rbs +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a6fde063384b381fd26d3bf8dd318e23ed68a76f2389bfe9ae5a25f6868106a
|
4
|
+
data.tar.gz: dc16f5b1a5ad0e9e4d40f7cbb7bcb29fe9224ed9e39cd715e4fe42199cc6bd81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63745922fe29a07bb57f3313328c5afb1ce1190cafec5b1d91a129075eaa7ee69de4799df60800711d76df2aeb364e5b7b46f94749ac6b1b72f8891c0e37aa8c
|
7
|
+
data.tar.gz: 78b0c4fd62495d09a623815f8aa6410c65db0ac6d63ac8bfc8851d8932afffd2b87883716daa93c95b7482c56a2e3ec86cf5f4b9d39f68ecb5b206bd67380dbb
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## [0.4.0] - 2022-01-14
|
2
|
+
|
3
|
+
- Fixes bug where too many letters would get marked as yellow. Resolves
|
4
|
+
[https://github.com/JonathanWThom/wordle/issues/3](https://github.com/JonathanWThom/wordle/issues/3).
|
5
|
+
|
1
6
|
## [0.3.0] - 2022-01-10
|
2
7
|
|
3
8
|
- Adds a better world list. From the Wordle source itself : )
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
wordle (0.
|
4
|
+
wordle (0.4.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
|
+
debug (1.4.0)
|
11
|
+
irb (>= 1.3.6)
|
12
|
+
reline (>= 0.2.7)
|
10
13
|
diff-lcs (1.5.0)
|
14
|
+
io-console (0.5.11)
|
15
|
+
irb (1.4.1)
|
16
|
+
reline (>= 0.3.0)
|
11
17
|
parallel (1.21.0)
|
12
18
|
parser (3.1.0.0)
|
13
19
|
ast (~> 2.4.1)
|
14
20
|
rainbow (3.0.0)
|
15
21
|
rake (13.0.6)
|
16
22
|
regexp_parser (2.2.0)
|
23
|
+
reline (0.3.1)
|
24
|
+
io-console (~> 0.5)
|
17
25
|
rexml (3.2.5)
|
18
26
|
rspec (3.10.0)
|
19
27
|
rspec-core (~> 3.10.0)
|
@@ -53,6 +61,7 @@ PLATFORMS
|
|
53
61
|
x86_64-linux
|
54
62
|
|
55
63
|
DEPENDENCIES
|
64
|
+
debug (>= 1.0.0)
|
56
65
|
rake (~> 13.0)
|
57
66
|
rspec (~> 3.0)
|
58
67
|
standard (~> 1.3)
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@ Ruby implementation of [Wordle](https://www.powerlanguage.co.uk/wordle/).
|
|
4
4
|
|
5
5
|
<img width="794" alt="Screen Shot 2022-01-10 at 9 18 19 PM" src="https://user-images.githubusercontent.com/22665228/148885575-39805830-274e-40e6-be14-4c6bc6db37ec.png">
|
6
6
|
|
7
|
-
|
8
7
|
## Installation
|
9
8
|
|
10
9
|
`gem install wordle`
|
@@ -23,6 +22,10 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
23
22
|
|
24
23
|
Bug reports and pull requests are welcome on GitHub at https://github.com/JonathanWThom/wordle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/JonathanWThom/wordle/blob/main/CODE_OF_CONDUCT.md).
|
25
24
|
|
25
|
+
## Acknowledgements
|
26
|
+
|
27
|
+
I cribbed my word list from the Wordle site itself. I have no association with the site or its creator, I'm just a fan!
|
28
|
+
|
26
29
|
## License
|
27
30
|
|
28
31
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -16,19 +16,26 @@ module Wordle
|
|
16
16
|
def colors
|
17
17
|
target_letters = @target_word.chars
|
18
18
|
guess_letters = @guess.chars
|
19
|
-
colored_letters =
|
19
|
+
colored_letters = []
|
20
20
|
|
21
21
|
guess_letters.each_with_index do |letter, i|
|
22
|
-
|
23
|
-
letter.green
|
24
|
-
|
25
|
-
letter.yellow
|
26
|
-
else
|
27
|
-
letter.gray
|
22
|
+
if letter == target_letters[i]
|
23
|
+
colored_letters[i] = letter.green
|
24
|
+
target_letters[i] = nil
|
28
25
|
end
|
29
26
|
end
|
30
27
|
|
31
|
-
|
28
|
+
guess_letters.each_with_index do |letter, i|
|
29
|
+
if colored_letters[i].nil?
|
30
|
+
colored_letters[i] = if target_letters.include?(letter)
|
31
|
+
letter.yellow
|
32
|
+
else
|
33
|
+
letter.gray
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
colored_letters.join("")
|
32
39
|
end
|
33
40
|
end
|
34
41
|
end
|
data/lib/wordle/version.rb
CHANGED
data/wordle.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Thom
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
12
|
-
dependencies:
|
11
|
+
date: 2022-01-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: debug
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0
|
13
27
|
description:
|
14
28
|
email:
|
15
29
|
- jonathanthom@hey.com
|
@@ -39,7 +53,6 @@ files:
|
|
39
53
|
- lib/wordle/list.rb
|
40
54
|
- lib/wordle/source.rb
|
41
55
|
- lib/wordle/version.rb
|
42
|
-
- sig/wordle.rbs
|
43
56
|
- wordle.gemspec
|
44
57
|
homepage: https://github.com/jonathanwthom/wordle
|
45
58
|
licenses:
|
data/sig/wordle.rbs
DELETED