word_searcher 1.03 → 2.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: 4d208411b1b5682954114fa23b1942b70daaf00e6c6474c26bf0670168f89f92
4
- data.tar.gz: edb28924f523b9738e4545f1efdfd7ad01d3f25afc4447422ea9aa1338de2686
3
+ metadata.gz: a76990cf74a7a3f223b538e098c33d407fca5c837540d5be7a83bd48c4da9f76
4
+ data.tar.gz: bc6cf0606edceb95b1db1bfcefeb5c6e8e76cced8b42d5399da19344f26b98f0
5
5
  SHA512:
6
- metadata.gz: e544f6bb52da22f54f9ca7d40512701d54347be7e4232ff22f2fdb6c585a8dee8c05c56104464507a832d43bda45eb33b0e1f5b23c9ab39b4d312c78e61ddaa3
7
- data.tar.gz: 15efceb774fc23f961c0788e59c2653a5981bc3f346502d6239b4b68a981bbe978c104561e95be3f51bb78ff6caaa313d5a7c4a233910cc354c6cab90b77a1f1
6
+ metadata.gz: 1846eaaf413cc6029049e7e81f56bfb0affff39fa76ee79a3ce428a7a8d16275970c4288837ccccab55765b77c333d9585bec8e9a6765a67cce9491372987a57
7
+ data.tar.gz: d94a43e1ee7311f059f59b7f0fafeefa5b1786c57fc6fd8fbeffea1dd577d62d14d79858cd21780f5828a179886dfd3bf95375f8c49853ee5a24555b3d4f8bd6
@@ -1,6 +1,7 @@
1
1
 
2
2
  module WordSearcher
3
3
  class Solver
4
+ attr_accessor :puzzle, :coords, :word_chars, :word
4
5
 
5
6
  def initialize
6
7
  @word = []
@@ -47,6 +48,7 @@ module WordSearcher
47
48
  coord_hsh = { row: row, col: col, ri: ri, ci: ci }
48
49
  @coords << coord_hsh
49
50
  end
51
+ @coords
50
52
  end
51
53
 
52
54
  def iterate_coords
@@ -59,6 +61,7 @@ module WordSearcher
59
61
  end
60
62
  end
61
63
  end
64
+ @found
62
65
  end
63
66
 
64
67
  def get_neighbors(coord)
@@ -80,32 +83,6 @@ module WordSearcher
80
83
  end
81
84
  end
82
85
 
83
- # def self.make_puzzle
84
- # binding.pry
85
- # puzzles = []
86
- #
87
- # puzzles << { word: 'wolves',
88
- # puzzle: [["a", "w", "o", "l", "v", "e", "s"],
89
- # ["s", "o", "a", "w", "a", "h", "p"],
90
- # ["i", "t", "c", "k", "e", "t", "n"],
91
- # ["o", "t", "s", "d", "h", "o", "h"],
92
- # ["s", "e", "h", "g", "s", "t", "a"],
93
- # ["u", "r", "p", "i", "w", "e", "u"],
94
- # ["z", "s", "b", "n", "u", "i", "r"]] }
95
- #
96
- # puzzles << { word: 'wolves',
97
- # puzzle: [["a", "w", "o", "l", "v", "e", "s"],
98
- # ["s", "o", "a", "w", "a", "h", "p"],
99
- # ["i", "t", "c", "k", "e", "t", "n"],
100
- # ["o", "t", "s", "d", "h", "o", "h"],
101
- # ["s", "e", "h", "g", "s", "t", "a"],
102
- # ["u", "r", "p", "i", "w", "e", "u"],
103
- # ["z", "s", "b", "n", "u", "i", "r"]] }
104
- #
105
- # puzzle = puzzles.sample
106
- # end
107
-
108
-
109
86
  def generate_puzzle
110
87
  word = @word
111
88
  word = word.chars
@@ -129,6 +106,30 @@ module WordSearcher
129
106
  end
130
107
 
131
108
 
109
+ ### Older Deprecated Method. Keep for Reference. ###
110
+ # def self.make_puzzle
111
+ # puzzles = []
112
+ #
113
+ # puzzles << { word: 'wolves',
114
+ # puzzle: [["a", "w", "o", "l", "v", "e", "s"],
115
+ # ["s", "o", "a", "w", "a", "h", "p"],
116
+ # ["i", "t", "c", "k", "e", "t", "n"],
117
+ # ["o", "t", "s", "d", "h", "o", "h"],
118
+ # ["s", "e", "h", "g", "s", "t", "a"],
119
+ # ["u", "r", "p", "i", "w", "e", "u"],
120
+ # ["z", "s", "b", "n", "u", "i", "r"]] }
121
+ #
122
+ # puzzles << { word: 'wolves',
123
+ # puzzle: [["a", "w", "o", "l", "v", "e", "s"],
124
+ # ["s", "o", "a", "w", "a", "h", "p"],
125
+ # ["i", "t", "c", "k", "e", "t", "n"],
126
+ # ["o", "t", "s", "d", "h", "o", "h"],
127
+ # ["s", "e", "h", "g", "s", "t", "a"],
128
+ # ["u", "r", "p", "i", "w", "e", "u"],
129
+ # ["z", "s", "b", "n", "u", "i", "r"]] }
130
+ #
131
+ # puzzle = puzzles.sample
132
+ # end
132
133
 
133
134
 
134
135
  end
@@ -1,3 +1,3 @@
1
1
  module WordSearcher
2
- VERSION = "1.03"
2
+ VERSION = "2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word_searcher
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.03'
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Booth
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport