about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/Octans/CLI.rakumod6
-rw-r--r--lib/Octans/Puzzle.rakumod6
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/Octans/CLI.rakumod b/lib/Octans/CLI.rakumod
index 0672761..3a5be30 100644
--- a/lib/Octans/CLI.rakumod
+++ b/lib/Octans/CLI.rakumod
@@ -51,7 +51,11 @@ multi sub MAIN(
                 print " " x 3;
                 for ^$puzzle.grids[$y].elems -> $x {
                     printf " {$puzzle.grids[$y][$x]}%s",
-                    @visited[$y][$x] ?? "/" !! " ";
+                    @visited[$y][$x]
+                     # visited gray squares get marked with "*",
+                     # visited squares with "/" & unvisited with " ".
+                     ?? ($puzzle.is-gray-square($y, $x) ?? "*" !! "/")
+                     !! " ";
                 }
                 print "\n";
             }
diff --git a/lib/Octans/Puzzle.rakumod b/lib/Octans/Puzzle.rakumod
index 731cc8e..e88a74a 100644
--- a/lib/Octans/Puzzle.rakumod
+++ b/lib/Octans/Puzzle.rakumod
@@ -17,4 +17,10 @@ class Puzzle is export {
 
     # Accessor for @!gray-squares.
     method gray-squares() { @!gray-squares; }
+
+    # Given $y, $x where $y is row index & $x is column index,
+    # is-gray-square returns if the cell is a gray square.
+    method is-gray-square(Int $y, Int $x) {
+        return so @!gray-squares.grep(($y, $x));
+    }
 }
.com> 2015-04-28 23:53:37 +0100 committer James Booth <boothj5@gmail.com> 2015-04-28 23:53:37 +0100 Added ui events module' href='/danisanti/profani-tty/commit/Makefile.am?id=d3698e6bee7985cd1707ec7b50fe61a5bf0c2829'>d3698e6b ^
c1ee75da ^

9aa282f6 ^
107fdd35 ^
0d15c710 ^
4dc48b4b ^
1809064d ^
4c6cfcdc ^
2490f5b4 ^
4c6cfcdc ^
36265dde ^
92837ec1 ^
c1ee75da ^
c1ee75da ^

21ab1821 ^
c1ee75da ^
264fc55a ^
d782b007 ^
6d6bb645 ^
7842b0d1 ^
107fdd35 ^



c16871d1 ^
107fdd35 ^
d1f8c6cd ^
b9119b43 ^
7638f379 ^
4c6cfcdc ^
2490f5b4 ^
4c6cfcdc ^
107fdd35 ^
92837ec1 ^
107fdd35 ^
107fdd35 ^
447d2358 ^
21ab1821 ^
107fdd35 ^

0d15c710 ^

6a9e1930 ^
9aa282f6 ^

424f52c3 ^
32da6548 ^
d3698e6b ^
68ed20f1 ^



























d782b007 ^
e9194452 ^
68ed20f1 ^







97c5072f ^
d782b007 ^

0fbaa6f5 ^
d782b007 ^
fa89e2aa ^
0d15c710 ^
fa89e2aa ^

0d15c710 ^
264fc55a ^
6d6bb645 ^
68ed20f1 ^
7638f379 ^
0c1092fd ^

1809064d ^

0c1092fd ^
3ceb9b0d ^
fa89e2aa ^
6d6bb645 ^
7e4b1b1d ^
0fbaa6f5 ^
fa89e2aa ^

0fbaa6f5 ^
fa89e2aa ^
264fc55a ^

d782b007 ^
0fbaa6f5 ^
3ceb9b0d ^



0fbaa6f5 ^


d782b007 ^
68ed20f1 ^






2655d9e8 ^
0c1092fd ^

01394d6c ^
0fbaa6f5 ^

0c1092fd ^

13ee16de ^
0fbaa6f5 ^


















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