-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
1413 lines (1213 loc) · 45.8 KB
/
index.html
File metadata and controls
1413 lines (1213 loc) · 45.8 KB
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<link href="/css/slitherlink.css" rel="stylesheet">
<aside class="sidebar sidebar-left">
<div class="sticky-content">
<nav>
<div>Contents</div>
<ul>
<li><a href="#what-is-slitherlink">What is Slitherlink?</a></li>
<li><a href="#playing-slitherlink">Playing Slitherlink</a></li>
<li><a href="#introduction-to-solving">Introduction to Solving</a></li>
<li><a href="#sectors-and-parity">Sectors and Parity</a></li>
<li><a href="#alternative-representations">Alternative Representations</a></li>
<li><a href="#alternative-tilings">Alternative Tilings</a></li>
<li><a href="#coloring">Coloring</a></li>
<li><a href="#colors-and-sectors">Colors and Sectors</a></li>
<li><a href="#highlander">Highlander</a></li>
<li><a href="#loops-and-regions">Loops and Regions</a></li>
<li><a href="#more-patterns">More Patterns</a></li>
<li><a href="#practice">Practice</a></li>
</ul>
</nav>
</div>
</aside>
<aside class="sidebar sidebar-right">
<div class="sticky-content">
<nav>
<div><a href="./play" class="want-to-play">Want to Play?</a></div>
<ul>
<li><a href="./play" class="play-slitherlink">Play Slitherlink!</a></li>
</ul>
<div style="margin-top: 2rem;">Related</div>
<ul>
<li><a href="./rule-explorer">Pattern Explorer</a></li>
</ul>
</nav>
</div>
</aside>
<main>
<section id="what-is-slitherlink">
<h2 style="margin-top: 0;">What is Slitherlink?</h2>
<div class="examples">
<div class="example">
<div id="simple-puzzle-empty" class="example-div"></div>
<span class="caption">
Unsolved puzzle
</span>
</div>
<div class="example">
<div id="simple-puzzle-partial" class="example-div"></div>
<span class="caption">
Partially solved puzzle
</span>
</div>
<div class="example">
<div id="simple-puzzle-complete" class="example-div"></div>
<span class="caption">
Completed puzzle
</span>
</div>
</div>
<p>
<a href="https://en.wikipedia.org/wiki/Slitherlink">Slitherlink</a> is a logic puzzle where you draw a single
continuous loop on a grid. The goal is to connect dots without crossing or overlapping, creating a loop that adheres
to specific rules based on the numbers in some cells.
</p>
<p>
The loop must satisfy the following rules:
</p>
<ul>
<li>The loop cannot cross or touch itself.</li>
<li>Each numbered cell must have exactly that number of sides in the loop.</li>
</ul>
<p>
A <em>valid</em> puzzle consists of a grid of cells with numbers in some of them, such that there is a unique solution.
</p>
</section>
<section id="playing-slitherlink">
<h2>Playing Slitherlink</h2>
<p class="p-center">
<a href="./play"><img src="./images/example-play-classic.png" style="width: auto; height: auto; max-width: 150px;" alt="Classic Play Interface"></a>
<a href="./play"><img src="./images/example-play-dark.png" style="width: auto; height: auto; max-width: 150px;" alt="Dark Mode with Colors Play Interface"></a>
</p>
<p class="p-center">
<a href="./play">Click to play!</a>
</p>
<p>
If you would like to try out any of the solving techniques below, I have made a
mobile-friendly <a href="./play">Slitherlink web app</a> that you can use to play with all of the concepts discussed below
(including advanced coloring and sectors).
</p>
<p>
The <a href="https://www.puzzles-mobile.com/loop">Puzzles Mobile</a> and <a href="https://krazydad.com/play/slitherlink/">KrazyDad</a>
interfaces also provide simple coloring tools to help solve puzzles.
</p>
</section>
<section id="introduction-to-solving">
<h2>Introduction to Solving</h2>
<p>
If you're new to Slitherlink, the <a href="https://en.wikipedia.org/wiki/Slitherlink">Wikipedia article</a> is a great
starting point. There are also excellent
<a href="https://www.conceptispuzzles.com/index.aspx?uri=puzzle/slitherlink/techniques">resources</a> and
<a href="https://puzzleparasite.blogspot.com/2011/11/slitherlink-pattern-guide_23.html">guides</a> available online.
</p>
<p>
It is highly recommended to avoid guessing, and instead to use logical deductions to solve the puzzle. Guessing is
great for learning, but makes solving larger puzzles disappointing when you realize you made a mistake!
</p>
<h3>Marking X's</h3>
<div class="examples">
<div class="example">
<div id="notation-red-x" class="example-div"></div>
<span class="caption">
Marked X's where lines cannot go
</span>
</div>
</div>
<p>
One common technique is to mark cells where lines cannot go with an "X". This helps to visualize where lines must go.
</p>
<h3>Basic Patterns</h3>
<p>
Some of the patterns only apply to puzzles that are larger than the pattern (i.e. they assume that a small loop would not be the solution to the entire puzzle).
</p>
<h4>Lines and Dots</h4>
<p>
Since the loop cannot cross itself, this means each dot will have either <strong>zero or two</strong> lines connected
to it.
</p>
<div class="examples">
<div class="example">
<div id="rule-two-black-to-red" class="example-div"></div>
<span class="caption">
Two lines connected to a dot prevent any other lines connecting to that dot.
<br>
<strong>Note:</strong> When you see the left pattern when solving, you can mark the changes on the right.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="rule-two-red-to-black" class="example-div"></div>
<span class="caption">
If there is one line connected to a dot, and all other potential lines are marked with an X except for one, that line must be connected.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="rule-three-red-to-red" class="example-div"></div>
<span class="caption">
If there is only space for one line to connect to a dot, no lines can connect to that dot.
</span>
</div>
</div>
<h4>Borders are X's</h4>
<p>
For patterns, it is useful to treat the border of the puzzle as if it extended out and was marked with X's.
This applies to corners and edges, and is useful for starting a puzzle!
</p>
<div class="examples">
<div class="example">
<div style="display: flex; gap: 50px; justify: center; margin: 0 auto;">
<div id="edge-clipped-puzzle" class="example-flexed-div"></div>
<div id="edge-red-puzzle" class="example-flexed-div"></div>
</div>
<span class="caption">
The corner on the left is equivalent to the (extended) example on the right by adding X's.
</span>
</div>
</div>
<h4>No Loops</h4>
<div class="examples">
<div class="example">
<div id="no-trivial-loop" class="example-div"></div>
<span class="caption">
If a line would create a small loop (that is not the solution to the entire puzzle), it cannot be connected, and can be marked with an X.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="no-loop-a" class="example-div"></div>
<span class="caption">
Similarly, any "forced" loops can be marked with X's. Here, a line going up would create a square loop.
</span>
</div>
</div>
<h4>Basic Numbers</h4>
<p>
Lines and X's can sometimes be deduced just from the number of a cell.
</p>
<div class="examples">
<div class="example">
<div id="basic-number-zero" class="example-div"></div>
<span class="caption">
No lines can surround a 0.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="basic-number-three-red" class="example-div"></div>
<span class="caption">
A single X on a 3 will result in lines.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="basic-number-one-black" class="example-div"></div>
<span class="caption">
A single line on a 1 will result in X's.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="basic-number-one-red" class="example-div"></div>
<span class="caption">
Three X's on a 1 will result in a single line.
</span>
</div>
</div>
<div class="examples examples-flex">
<div class="example">
<div id="basic-number-two-black-a" class="example-div"></div>
</div>
<div class="example">
<div id="basic-number-two-black-b" class="example-div"></div>
</div>
<div class="example">
<div id="basic-number-two-red-a" class="example-div"></div>
</div>
<div class="example">
<div id="basic-number-two-red-b" class="example-div"></div>
</div>
</div>
<h4>Corner Cases</h4>
<div class="examples">
<div class="example">
<div id="corner-one" class="example-div"></div>
<span class="caption">
A 1 in the corner will get two X's (remember, corners are like X's!)
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="corner-three" class="example-div"></div>
<span class="caption">
A 3 in the corner will get two lines (remember, corners are like X's!)
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="corner-two-general" class="example-div"></div>
<span class="caption">
This is the general case for a 2 with corner-like X's. If it is in a true corner, you will get two lines.
</span>
</div>
</div>
<h4>Edge Cases</h4>
<div class="examples examples-flex">
<div class="example">
<div id="edge-three-one" class="example-div"></div>
</div>
<div class="example">
<div id="edge-one-one" class="example-div"></div>
</div>
</div>
<h3>Annotated Example</h3>
<p>
Given the patterns above, let's solve a simple puzzle.
</p>
<div class="examples">
<div class="example">
<div id="annotated-simple-0" class="example-div"></div>
<span class="caption">
Our starting puzzle.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-1" class="example-div"></div>
<span class="caption">
We can mark X's around all of the 0's in the puzzle.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-2" class="example-div"></div>
<span class="caption">
There is a 3 with an X, so we can fill in lines.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-3" class="example-div"></div>
<span class="caption">
There are two dots that have two lines each; other potential lines get X'ed out.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-4" class="example-div"></div>
<span class="caption">
This also applies for the corner dots (but it may be harder to see).
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-5" class="example-div"></div>
<span class="caption">
We have two vertices where a single line meets two X's. They both must take the only remaining path.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-6" class="example-div"></div>
<span class="caption">
Similarly, this happens for the edge dots (the implicit X's at the corner apply).
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-7" class="example-div"></div>
<span class="caption">
Let's apply a more complicated pattern: the 3 has a dot that, while not in the corner, matches the corner-like
pattern. It gets two lines.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-7a" class="example-div"></div>
<span class="caption">
We created a joint-like two lines on a dot, so we mark in the remaining X.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-7b" class="example-div"></div>
<span class="caption">
A 3 with an X can have its remaining lines filled in.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-8" class="example-div"></div>
<span class="caption">
We can use the "line on a 1" and "X's if there are two lines on a dot" rules to fill in some additional X's.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-9" class="example-div"></div>
<span class="caption">
We can repeatedly add lines where there are no other options (either edges, corners, or X's on all other options).
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-10" class="example-div"></div>
<span class="caption">
A 1 with a line will create X's.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="annotated-simple-11" class="example-div"></div>
<span class="caption">
We finish the puzzle with forced lines!
</span>
</div>
</div>
<h3>Common Patterns</h3>
<div class="examples examples-flex">
<div class="example">
<div id="three-three-diagonal" class="example-div"></div>
</div>
<div class="example">
<div id="three-three-adjacent" class="example-div"></div>
</div>
<div class="example">
<div id="three-incident-line" class="example-div"></div>
</div>
<div class="example">
<div id="two-spiked-red" class="example-div"></div>
</div>
<div class="example">
<div id="two-spiked-black" class="example-div"></div>
</div>
<div class="example">
<div id="three-two-red" class="example-div"></div>
</div>
<div class="example">
<div id="two-two-red" class="example-div"></div>
</div>
<div class="example">
<div id="one-incident" class="example-div"></div>
</div>
<div class="example">
<div id="one-anti-incident-a" class="example-div"></div>
</div>
<div class="example">
<div id="one-anti-incident-b" class="example-div"></div>
</div>
</div>
</section>
<section id="sectors-and-parity">
<h2>Sectors and Parity</h2>
<h3>Only One</h3>
<p>
It is useful to mark sectors (adjacent pairs of potential lines) with a few properties. The most powerful marking
says that "exactly one of these will be a line, and the other will be an X". We denote this below by drawing a
red curve between the two potential lines.
</p>
<div class="examples">
<div class="example">
<div id="only-one-across-two" class="example-div"></div>
<span class="caption">
If a pair of edges of a 2 will have exactly one line, then the <em>other</em> pair will <em>also</em> have exactly one line.
</span>
</div>
</div>
<p>
On square grids, this property also applies across a dot to the opposite sector:
</p>
<div class="examples">
<div class="example">
<div id="only-one-crossing" class="example-div"></div>
<span class="caption">
If a pair of edges of a 2 will have exactly one line, then the <em>other</em> pair will <em>also</em> have exactly one line.
</span>
</div>
</div>
<p>
Thus the only-one sector property will propagate across a chain of diagonally-connected 2s (in a square grid)!
</p>
<p>
This type of parity arises naturally in many common situations:
</p>
<div class="examples examples-flex">
<div class="example">
<div id="one-incident-sector" class="example-div"></div>
</div>
<div class="example">
<div id="two-incident-sector" class="example-div"></div>
</div>
<div class="example">
<div id="three-incident-sector" class="example-div"></div>
</div>
<div class="example">
<div id="simple-incident-sector" class="example-div"></div>
</div>
</div>
<p>
It is particularly powerful, not just because it can propagate across 2s, but many of the reverse cases directly
deduce lines or X's:
</p>
<div class="examples examples-flex">
<div class="example">
<div id="one-incident-reverse-sector" class="example-div"></div>
</div>
<div class="example">
<div id="two-incident-reverse-sector-a" class="example-div"></div>
</div>
<div class="example">
<div id="two-incident-reverse-sector-b" class="example-div"></div>
</div>
<div class="example">
<div id="three-incident-reverse-sector" class="example-div"></div>
</div>
<div class="example">
<div id="simple-incident-reverse-sector-a" class="example-div"></div>
</div>
<div class="example">
<div id="simple-incident-reverse-sector-b" class="example-div"></div>
</div>
</div>
<p>
Whenever there is a line or an X in a sector with "only one" line, you can immediately mark the opposite!
</p>
<p>
The only-one sector can solve the following example patterns, but much more:
</p>
<div class="examples examples-flex">
<div class="example">
<div id="only-one-example-a" class="example-div"></div>
</div>
<div class="example">
<div id="only-one-example-b" class="example-div"></div>
</div>
<div class="example">
<div id="only-one-example-c" class="example-div"></div>
</div>
</div>
<h3>Not One</h3>
<p>
A dual to the "only one" sector is the "not one" sector. This is a sector where either both are lines or both are X's.
We will mark this with two blue curves between the two potential lines.
</p>
<div class="examples">
<div class="example">
<div id="two-spike-sector" class="example-div"></div>
<span class="caption">
This comes up most naturally with 2-in-a-corner pattern. Note that this also includes only-one sectors, and
can be incredibly constraining. In this case, the upper-left of the 2 ALSO has the not-one sector property, but
isn't marked visually by the system due to the triviality (only two places for lines).
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="not-one-propagation" class="example-div"></div>
<span class="caption">
Not-one sectors propagate across dots in square grids.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="two-spike-from-sector" class="example-div"></div>
<span class="caption">
Not-one sectors also create the 2-in-a-corner pattern.
</span>
</div>
</div>
<p>
Using the above patterns, it follows that any diagonal chain of 2s will propagate the not-one sector property across
the entire chain!
</p>
<h3>Not Two and Not Zero</h3>
<p>
Similarly, we can mark sectors when we can rule out two lines or zero lines. We will mark not-two with a single dashed
orange curve, and not-zero with a double dashed green curve.
</p>
<div class="examples">
<div class="example">
<div id="one-not-two" class="example-div"></div>
<span class="caption">
Not-two sectors naturally form around a 1.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="three-not-zero" class="example-div"></div>
<span class="caption">
Not-zero sectors naturally form around a 3.
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="not-zero-not-two-propagation" class="example-div"></div>
<span class="caption">
If a sector is a not-zero, then any opposite sector is a not-two.
</span>
</div>
</div>
<h3>Sector Combinations</h3>
<p>
When rules overlap and you would mark multiple sectors on a single pair of potential lines, you can combine them into
more precise states:
</p>
<ul>
<li>
Not-zero (green) and not-one (blue) => both are lines!
</li>
<li>
Not-two (orange) and not-one (blue) => both are X's!
</li>
<li>
Not-zero (green) and not-two (orange) => only-one (red)
</li>
</ul>
<div class="examples">
<div class="example">
<div id="second-diagonal-three" class="example-div"></div>
<span class="caption">
This rule can be directly derived from the above sectors rules directly. Each 3 creates not-zero sectors,
and the not-two sectors propagate across the diagonal. Since each pair of potential lines has not-zero and not-two,
it is equivalent to only-one. Previous sectors rules show what only-one with a 3 combines into.
</span>
</div>
</div>
<h3>Common Sector Patterns</h3>
<div class="examples examples-flex">
<div class="example">
<div id="line-not-two" class="example-div"></div>
</div>
<div class="example">
<div id="adjacent-not-one" class="example-div"></div>
</div>
<div class="example">
<div id="not-zero-three-edge" class="example-div"></div>
</div>
<div class="example">
<div id="not-two-double" class="example-div"></div>
</div>
<div class="example">
<div id="adjacent-propagation" class="example-div"></div>
</div>
<div class="example">
<div id="two-partial-sector-a" class="example-div"></div>
</div>
<div class="example">
<div id="two-partial-sector-b" class="example-div"></div>
</div>
<div class="example">
<div id="no-sector-loop" class="example-div"></div>
</div>
<div class="example">
<div id="two-sector-prop-a" class="example-div"></div>
</div>
<div class="example">
<div id="two-sector-prop-b" class="example-div"></div>
</div>
</div>
<h3>Parity</h3>
<p>
The following rules are very powerful when combined. They represent the concept of <a href="https://en.wikipedia.org/wiki/Parity_(mathematics)">parity</a>,
in general the concept of even/odd.
</p>
<p>
Most notably, if all but one sector of a square are marked with only-one or not-one, you can deduce the last sector!
If you look at any closed region in the puzzle (e.g. a square, but it can be arbitrary), the number of times the
final loop will cross it <strong>will be even</strong>. Every only-one sector is a "crossing" of our square, and
every not-one sector is a "non-crossing".
</p>
<p>
For example, in a square:
</p>
<ul>
<li>
Three only-one sectors => four only-one sectors (last corner is only-one)
</li>
<li>
Three not-one sectors => four not-one sectors (last corner is not-one)
</li>
<li>
Two not-one sectors and one only-one sector => two of each (last corner is only-one)
</li>
</ul>
<p>
For a concrete case of parity in action, see <a href="https://www.reddit.com/r/slitherlink/comments/18n6w82/comment/ke9rlvn/">this reddit thread</a>.
</p>
<div class="examples examples-flex">
<div class="example">
<div id="sector-parity-a" class="example-div"></div>
</div>
<div class="example">
<div id="sector-parity-b" class="example-div"></div>
</div>
<div class="example">
<div id="sector-parity-c" class="example-div"></div>
</div>
<div class="example">
<div id="sector-parity-d" class="example-div"></div>
</div>
<div class="example">
<div id="sector-parity-e" class="example-div"></div>
</div>
</div>
</section>
<section id="alternative-representations">
<h2>Alternative Representations</h2>
<p>
The classic form of dots and X's can be harder to use in a few ways:
</p>
<ul>
<li>
The implicit "lines between dots" can be hard to visualize multiple pathways (particularly for coloring/Jordan curve
solving).
</li>
<li>
The implicit "lines between dots" doesn't work as well for non-square grids (harder to visualize the potential shapes).
</li>
<li>
The X's can be awkward on non-square grids (they look weird either rotated or non-rotated).
</li>
<li>
Sectors are not as clear with the implicit lines.
</li>
</ul>
<p>
For example, the same puzzle is represented below with two methods. The left "arm" of the puzzle (with the 3)
needs to connect back to the rest with two line paths. There happens to be a "cut" (marked in red) where there are
only two places for lines to pass through (at each endpoint of the red line). Making the possible paths explicit
helps identify this type of case.
</p>
<div class="examples examples-flex">
<div class="example">
<div id="unclear-classic" class="example-div"></div>
</div>
<div class="example">
<div id="unclear-colors" class="example-div"></div>
</div>
</div>
In these other representations, "lines" are drawn with a <em>thick, bold</em> style, "possible lines" are drawn with
a <em>thin</em> style, and X's are represented simply by the absence of a line.
<div class="examples">
<div class="example">
<div id="unclear-visible-red" class="example-div"></div>
<span class="caption">
It is also possible to mark the location of X's with other styles.
</span>
</div>
</div>
</section>
<section id="alternative-tilings">
<h2>Alternative Tilings</h2>
<p>
Any <a href="https://en.wikipedia.org/wiki/Planar_graphs">planar graph</a> or tiling can be used to make a puzzle.
</p>
<div class="examples examples-flex">
<div class="example">
<div id="rhombille-puzzle" class="example-div"></div>
</div>
<div class="example">
<div id="hexagonal-puzzle" class="example-div"></div>
</div>
<div class="example">
<div id="cairo-puzzle" class="example-div"></div>
</div>
<div class="example">
<div id="floret-puzzle" class="example-div"></div>
</div>
<div class="example">
<div id="rhombitrihexagonal-puzzle" class="example-div"></div>
</div>
</div>
<p>
Each of which has different rules:
</p>
<div class="examples examples-flex">
<div class="example">
<div id="hex-five-five" class="example-div"></div>
</div>
<div class="example">
<div id="hex-five-four-five" class="example-div"></div>
</div>
</div>
<p>
However, it is possible to create/compute "general" rules that work across tilings:
</p>
<div class="examples examples-flex">
<div class="example">
<div id="general-rule-square" class="example-div"></div>
</div>
<div class="example">
<div id="general-rule-rhombille" class="example-div"></div>
</div>
<div class="example">
<div id="general-rule-snub-square" class="example-div"></div>
</div>
<div class="example">
<div id="general-rule-deltoidal-trihexagonal" class="example-div"></div>
</div>
<div class="example">
<div id="general-rule-rhombitrihexagonal" class="example-div"></div>
</div>
</div>
<div class="examples">
<div class="example">
<div id="general-rule-generic" class="example-div"></div>
<span class="caption">
All of the above rules are represented by this form (will be described later in the technical details, but red circles denote "all other unspecified potential lines get X'ed").
</span>
</div>
</div>
</section>
<section id="coloring">
<h2>Coloring</h2>
<p>
Since the loop is a <a href="https://en.wikipedia.org/wiki/Jordan_curve_theorem">Jordan curve</a>, it divides the cells
into two regions, one inside and one outside. This can be used to deduce lines and X's, or even to solve directly.
</p>
<p>
Coloring is where we mark the deduction "this cell will be in the same/opposite region as this other cell".
</p>
<div class="examples">
<div class="example">
<div id="solved-puzzle" class="example-div"></div>
<span class="caption">
In this solved puzzle, the outside is white, and the inside is gray.
</span>
</div>
</div>
<p>
A common way of solving with coloring is to mark colors just for the inside and outside of the loop.
</p>
<div class="examples">
<div class="example">
<div id="partial-inside-outside-puzzle" class="example-div"></div>
<span class="caption">
Inside/outside colors marked (not using general coloring, so lines are highlighted for visibility).
</span>
</div>
</div>
<p>
However, this is less helpful on larger puzzles, where we may be able to deduce coloring information in the middle,
and it is far from any inside/outside coloring.
</p>
<p>
When coloring, conceptually we get pairs of opposing regions (where every cell in the two different regions is of
opposite color, and every cell in the same region is of the same color).
</p>
<p>
To be able to solve with this information, it helps to use a single color hue for each region pair, but picking
a lighter color and darker color to indicate the "opposite" regions:
</p>
<div class="examples">
<div class="example">
<div id="coloring-pairs-puzzle" class="example-div"></div>
<span class="caption">
Pairs with a lighter and darker color with the same hue will be on opposite sides of the loop.
Note how coloring can be disconnected (the upper-right pair of 3's forces the left and right cells to have
opposite colors), and the only-one sector from the 1 in the bottom right also does the same.
Note the single-color region in the middle-to-upper-left: if it where white (outside), it would split the
puzzle into two disconnected regions (the upper left would be isolated), which is not valid. Thus we could mark it
as being the "inside" color!
</span>
</div>
</div>
<div class="examples">
<div class="example">
<div id="pure-coloring-pairs-puzzle" class="example-div"></div>
<span class="caption">
We can also display and solve using <em>only</em> the coloring information.
</span>
</div>
</div>
<p>
This user interface tries to make colors as clear as possible (where pairs that are close to each other will have
different hues).
</p>
<p>
Additionally:
</p>
<ul>
<li>
Every line will force its adjacent cells to be of opposite colors.
</li>
<li>
Every X will force its adjacent cells to be of the same color.
</li>
</ul>
<p>
The opposite is also true: