about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-03-03 23:18:52 +0530
committerAndinus <andinus@nand.sh>2021-03-03 23:18:52 +0530
commit34dcef166e47d268e98973f609da470c59ed5f07 (patch)
treedd15d46051b5c41e731bcb53a331ed807ab69956
parent4c77f3376020ea13754b2f635ce07094cdc4a226 (diff)
downloadoctans-34dcef166e47d268e98973f609da470c59ed5f07.tar.gz
Change subroutine declaration style
From:
    sub t () {}

To:
    sub t() {}
-rw-r--r--lib/Octans/CLI.rakumod6
-rw-r--r--lib/Octans/Neighbors.rakumod4
-rw-r--r--lib/Octans/Puzzle/Get.rakumod2
-rw-r--r--lib/Octans/RangeSearch.rakumod4
-rw-r--r--lib/Octans/WordSearch.rakumod4
5 files changed, 7 insertions, 13 deletions
diff --git a/lib/Octans/CLI.rakumod b/lib/Octans/CLI.rakumod
index 48477ef..0719dcd 100644
--- a/lib/Octans/CLI.rakumod
+++ b/lib/Octans/CLI.rakumod
@@ -2,9 +2,9 @@ use Octans::Puzzle;
 use Octans::WordSearch;
 use Octans::Puzzle::Get;
 
-proto MAIN (|) is export { unless so @*ARGS { say $*USAGE; exit }; {*} }
+proto MAIN(|) is export { unless so @*ARGS { say $*USAGE; exit }; {*} }
 
-multi sub MAIN (
+multi sub MAIN(
     Str $path, #= path to the crossword (file or url)
     Str :$dict = (%?RESOURCES<mwords/354984si.ngl> //
                   "/usr/share/dict/words").Str, #= dictionary file
@@ -68,6 +68,6 @@ multi sub MAIN (
 }
 
 
-multi sub MAIN (
+multi sub MAIN(
     Bool :$version #= print version
 ) { say "Octans v" ~ $?DISTRIBUTION.meta<version>; }
diff --git a/lib/Octans/Neighbors.rakumod b/lib/Octans/Neighbors.rakumod
index 0c90b0c..cc46a25 100644
--- a/lib/Octans/Neighbors.rakumod
+++ b/lib/Octans/Neighbors.rakumod
@@ -1,9 +1,7 @@
-unit module Octans::Neighbors;
-
 # neighbors returns the neighbors of given index. Neighbors are cached
 # in @neighbors array. This way we don't have to compute them
 # everytime neighbors subroutine is called for the same position.
-sub neighbors (
+sub neighbors(
     @puzzle, Int $y, Int $x --> List
 ) is export {
     # @directions is holding a list of directions we can move in. It's
diff --git a/lib/Octans/Puzzle/Get.rakumod b/lib/Octans/Puzzle/Get.rakumod
index 1783796..f4094b2 100644
--- a/lib/Octans/Puzzle/Get.rakumod
+++ b/lib/Octans/Puzzle/Get.rakumod
@@ -2,7 +2,7 @@ use WWW;
 use Octans::Puzzle;
 
 # get-puzzle returns Puzzle.new() given input path.
-sub get-puzzle (
+sub get-puzzle(
     Str $path
 ) is export {
     my @grids;
diff --git a/lib/Octans/RangeSearch.rakumod b/lib/Octans/RangeSearch.rakumod
index e287d93..c6674a6 100644
--- a/lib/Octans/RangeSearch.rakumod
+++ b/lib/Octans/RangeSearch.rakumod
@@ -1,5 +1,3 @@
-unit module Octans::RangeSearch;
-
 # range-starts-with returns a subset of given @dict list that start
 # with $str. It should be faster than:
 #
@@ -7,7 +5,7 @@ unit module Octans::RangeSearch;
 #
 # @dict should be a sorted list of words. It performs binary lookup on
 # the list.
-sub range-starts-with (
+sub range-starts-with(
     @dict, Str $str --> List
 ) is export {
     # $lower, $upper hold the lower and upper index of the range
diff --git a/lib/Octans/WordSearch.rakumod b/lib/Octans/WordSearch.rakumod
index a1ed2c3..23487dc 100644
--- a/lib/Octans/WordSearch.rakumod
+++ b/lib/Octans/WordSearch.rakumod
@@ -1,12 +1,10 @@
-unit module Octans::WordSearch;
-
 use Octans::Neighbors;
 use Octans::RangeSearch;
 
 # word-search walks the given grid & tries to find words in the
 # dictionary. It walks in Depth-First manner (lookup Depth-First
 # search).
-sub word-search (
+sub word-search(
     # @dict holds the dictionary. @puzzle holds the puzzle.
     @dict, @puzzle,
 
0ec3c9dad33738caf6f55fb742a316bd5be'>32cd40ec ^
7f402c85 ^
d6c9fe63 ^
6dc1379b ^
b17c196d ^



87fbfc2d ^

9fdda88b ^

32cd40ec ^
9fdda88b ^

32cd40ec ^
87fbfc2d ^
2c3afb53 ^

6dc1379b ^

363be37f ^

32cd40ec ^
a2a6e35e ^
2c3afb53 ^







32cd40ec ^


de92036d ^
b17c196d ^
363be37f ^
260c3de2 ^
f43c2125 ^


7f402c85 ^

f43c2125 ^
87fbfc2d ^
32cd40ec ^


955a66a5 ^
32cd40ec ^

87fbfc2d ^
d6c9fe63 ^
9fdda88b ^
363be37f ^
b17c196d ^
87fbfc2d ^
12c3ee1e ^
9fdda88b ^


bc643692 ^
9fdda88b ^
286ca5a4 ^
9fdda88b ^



76d22198 ^








286ca5a4 ^
76d22198 ^




0685569c ^




286ca5a4 ^
0685569c ^






9fdda88b ^

90938fcb ^

9fdda88b ^
76d22198 ^
90938fcb ^

9fdda88b ^



76d22198 ^

48e40252 ^
cfb142b9 ^







76d22198 ^
de92036d ^
76d22198 ^



d6c9fe63 ^

9fdda88b ^

9fdda88b ^



7f402c85 ^
9fdda88b ^


de92036d ^
9fdda88b ^
32cd40ec ^
0685569c ^
16ecf053 ^
0685569c ^

32cd40ec ^

32cd40ec ^


7f402c85 ^





32cd40ec ^





32cd40ec ^

32cd40ec ^





4efc0ff3 ^
32cd40ec ^

7f402c85 ^

32cd40ec ^


a2a6e35e ^
32cd40ec ^

2e8c5d39 ^

9fdda88b ^
be13beeb ^

be13beeb ^









be13beeb ^


de92036d ^
76d22198 ^









b17c196d ^
548cd00a ^

b17c196d ^
de92036d ^
548cd00a ^

48e40252 ^
6e21584e ^
76d22198 ^




16ecf053 ^
0685569c ^
7f402c85 ^
16ecf053 ^
7f402c85 ^
0685569c ^

16ecf053 ^
0685569c ^



7f402c85 ^
de92036d ^
0685569c ^
f0eb3556 ^








e4630643 ^







4efc0ff3 ^


7f402c85 ^
4efc0ff3 ^
f0eb3556 ^
7381b17c ^
de92036d ^
f0eb3556 ^
4efc0ff3 ^
7381b17c ^
f0eb3556 ^
cfb142b9 ^
16ecf053 ^
7f402c85 ^

4efc0ff3 ^


f0eb3556 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320