wordle 0.3.0 → 0.4.0

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: ff0c43c46f9e5e2e25088128a3cd8e2f634bda564b98a0b36473c0d9fb1a25b7
4
- data.tar.gz: bbcaf825639fd41c6388b501388cc108048d1c4464e59a3cad7eaa2451586679
3
+ metadata.gz: 3a6fde063384b381fd26d3bf8dd318e23ed68a76f2389bfe9ae5a25f6868106a
4
+ data.tar.gz: dc16f5b1a5ad0e9e4d40f7cbb7bcb29fe9224ed9e39cd715e4fe42199cc6bd81
5
5
  SHA512:
6
- metadata.gz: 366f914646b492bd8c00f4a4334db6ebb494b447cd54c34ea0d6c47310be1ab7ed3af5662c05daf5bcf8056dbb0899db2848599525ed17859eb40e6b111d500b
7
- data.tar.gz: 1a21fa7349041d534f29588cb45b9ca41e4e0deef0d6812de0e1384a80613a94667b925b3c32cacf9d6d99bc587807b0419f416a9b6ebe16cb43142d1de13cce
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.3.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
- colored_letters += if letter == target_letters[i]
23
- letter.green
24
- elsif target_letters.include?(letter)
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
- colored_letters
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wordle
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/wordle.gemspec CHANGED
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
35
35
 
36
36
  # For more information and examples about making a new gem, check out our
37
37
  # guide at: https://bundler.io/guides/creating_gem.html
38
+ spec.add_development_dependency "debug", ">= 1.0.0"
38
39
  end
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.3.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-11 00:00:00.000000000 Z
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
@@ -1,4 +0,0 @@
1
- module Wordle
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end