about summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Print complete helpAndinus2021-02-281-1/+1
| | | | | Previously it wouldn't print the input file format but would only print the default $*USAGE.
* Remove sample puzzleAndinus2021-02-281-36/+19
|
* Fix the sample puzzle errorAndinus2021-02-191-4/+6
| | | | | | | | | | It would error out when the user runs sample puzzle because we're using $path.IO.f but that wasn't passed. It prints this error: Invocant of method 'f' must be an object instance of type 'IO::Path', not a type object of type 'IO::Path'.
* Handle reading puzzle from file within Octans::CLI moduleAndinus2021-02-182-30/+30
| | | | This makes it easier to understand.
* Fix the regex for puzzleAndinus2021-02-071-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The older regex fails on [today's puzzle] & I didn't really understand what it did. The newer one is simpler & I understand how it works. [today's puzzle] https://mastodon.art/@Algot/105690195742318751 Thanks to guifa on #raku@freenode, they explained me how they would build regex for this problem. I'm pasting the logs here: |[...] |10:35 <guifa> Smallest element here is the letter. Lots of ways to | represent it, but I’d go with \S+ |10:35 <guifa> The next smallest is the group of letters |10:36 <guifa> Which is what you just got with spaces in between it |10:36 <guifa> so you get (\S+)+ % \h |10:36 <guifa> Next you want to grab individual lines with that | pattern in it so |10:37 <guifa> ( (\S+)+ % \h )+ \n |10:37 <guifa> And lastly, you want to start the pattern after a | double return |[...] |10:39 <guifa> \n \n ( (\S+)+ % \h )+ % \n |10:41 <guifa> The only problem here is that this technically does | match Hint. So to limit things more, you can either | be stricter about the inner bit (using \S \*? instead | of \S+), explicitly putting “Hint\n\n” in the regex | start, or requiring more than one inner match (\S+) | ** 2..* % \h |[...] |10:47 <guifa> But you might consider breaking things out into | tokens |[...] |10:54 <guifa> I think a lot of times people try to write regex left | to right, when they need to make it small to big |10:54 <guifa> That’s part of the reason you have the grammars in | Raku — it really pushes you to think of things that | way I asked guifa before including this, they were okay with it.
* When computing neighbors, set it to an empty arrayAndinus2021-01-261-3/+6
| | | | | If we don't find any neighbors then we shouldn't have to recompute this result.
* Add an option to specify minimum lengthAndinus2021-01-241-2/+3
|
* Allow the input puzzle to be of any sizeAndinus2021-01-202-45/+34
| | | | | | | | | | | It should still be a 2d grid but can have any number of grids, not necessarily MxN. Even this is a valid input: a b c s d e r c This input should be valid even when parsing the url. It will certainly be valid when the input is a file.
* Read from file if passed, modify USAGEAndinus2021-01-202-53/+82
| | | | | | Previouly, the only way of passing the puzzle was to enter a url. Now octans is able to read from files too. If the file exist & it's readable then octans will read the puzzle from there.
* Re-structure for CPAN upload, include a dictionary file v0.1.0Andinus2021-01-195-6/+105
| | | | bin/octans calls lib/Octans/CLI.rakumod which has the MAIN subroutine.
* Re-implement octans, move subroutines to respective modulesAndinus2021-01-194-0/+246
Initially it went over the list of words & checked if they exist in the grid. This was very slow. Currently it walks the grid & checks if the current string exist in the dictionary. This is faster for these reasons: • The dictionary is sorted, we perform binary range search on the dictionary to return the list of all words that start with specific string. • Starting positions are limited. If the dictionary wasn't sorted then this probably would've been
296b8ac5e9'>79cb6ea5 ^
e35c2d68 ^
79cb6ea5 ^
e35c2d68 ^




79cb6ea5 ^


a232af2f ^
e35c2d68 ^
22d93b76 ^



a6deb480 ^


e35c2d68 ^
48f6d48a ^
a6deb480 ^
22d93b76 ^
a232af2f ^
6acea762 ^
a232af2f ^



20037b7c ^
e35c2d68 ^

20037b7c ^


3315a7d3 ^
a232af2f ^

e35c2d68 ^
a232af2f ^

e35c2d68 ^
a232af2f ^



6acea762 ^
a232af2f ^

6acea762 ^
a232af2f ^

6acea762 ^
a232af2f ^








e35c2d68 ^

6acea762 ^

89fd0bf2 ^



48f6d48a ^
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