Skip to content

Commit c460cff

Browse files
committed
Purge trailing whitespace in 99-problems
1 parent 73e1d6c commit c460cff

18 files changed

+41
-41
lines changed

99-problems/99-problems.pod

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ Adjacency-list form
928928
Note that the adjacency-list does not have the information on whether it is a graph or a digraph.
929929

930930
Human-friendly form
931-
[s > r, t, u > r, s > u, u > s, v > u]
931+
[s > r, t, u > r, s > u, u > s, v > u]
932932

933933
Finally, graphs and digraphs may have additional information attached to
934934
nodes and edges (arcs). For the nodes, this is no problem, as we can easily
@@ -1002,7 +1002,7 @@ N1 -> N2 such that for any nodes X,Y of N1, X and Y are adjacent if and only
10021002
if f(X) and f(Y) are adjacent.
10031003

10041004
Write a predicate that determines whether two graphs are isomorphic. Hint:
1005-
Use an open-ended list to represent the function f.
1005+
Use an open-ended list to represent the function f.
10061006

10071007
=head2 P86 (**) Node degree and graph coloration
10081008

@@ -1132,14 +1132,14 @@ Sudoku puzzles go like this:
11321132
. . . | . . 6 | . 9 1 8 5 3 | 4 7 6 | 2 9 1
11331133
| | | |
11341134
2 4 . | . . 1 | 5 . . 2 4 6 | 3 9 1 | 5 7 8
1135-
1135+
11361136

11371137
Every spot in the puzzle belongs to a (horizontal) row and a (vertical)
11381138
column, as well as to one single 3x3 square (which we call "square" for
11391139
short). At the beginning, some of the spots carry a single-digit number
11401140
between 1 and 9. The problem is to fill the missing spots with digits in
11411141
such a way that every number between 1 and 9 appears exactly once in each
1142-
row, in each column, and in each square.
1142+
row, in each column, and in each square.
11431143

11441144
=head2 P98 (***) Nonograms
11451145

@@ -1157,18 +1157,18 @@ given only these lengths.
11571157

11581158
Problem statement: Solution:
11591159

1160-
|_|_|_|_|_|_|_|_| 3 |_|X|X|X|_|_|_|_| 3
1161-
|_|_|_|_|_|_|_|_| 2 1 |X|X|_|X|_|_|_|_| 2 1
1162-
|_|_|_|_|_|_|_|_| 3 2 |_|X|X|X|_|_|X|X| 3 2
1163-
|_|_|_|_|_|_|_|_| 2 2 |_|_|X|X|_|_|X|X| 2 2
1164-
|_|_|_|_|_|_|_|_| 6 |_|_|X|X|X|X|X|X| 6
1165-
|_|_|_|_|_|_|_|_| 1 5 |X|_|X|X|X|X|X|_| 1 5
1166-
|_|_|_|_|_|_|_|_| 6 |X|X|X|X|X|X|_|_| 6
1167-
|_|_|_|_|_|_|_|_| 1 |_|_|_|_|X|_|_|_| 1
1168-
|_|_|_|_|_|_|_|_| 2 |_|_|_|X|X|_|_|_| 2
1169-
1 3 1 7 5 3 4 3 1 3 1 7 5 3 4 3
1170-
2 1 5 1 2 1 5 1
1171-
1160+
|_|_|_|_|_|_|_|_| 3 |_|X|X|X|_|_|_|_| 3
1161+
|_|_|_|_|_|_|_|_| 2 1 |X|X|_|X|_|_|_|_| 2 1
1162+
|_|_|_|_|_|_|_|_| 3 2 |_|X|X|X|_|_|X|X| 3 2
1163+
|_|_|_|_|_|_|_|_| 2 2 |_|_|X|X|_|_|X|X| 2 2
1164+
|_|_|_|_|_|_|_|_| 6 |_|_|X|X|X|X|X|X| 6
1165+
|_|_|_|_|_|_|_|_| 1 5 |X|_|X|X|X|X|X|_| 1 5
1166+
|_|_|_|_|_|_|_|_| 6 |X|X|X|X|X|X|_|_| 6
1167+
|_|_|_|_|_|_|_|_| 1 |_|_|_|_|X|_|_|_| 1
1168+
|_|_|_|_|_|_|_|_| 2 |_|_|_|X|X|_|_|_| 2
1169+
1 3 1 7 5 3 4 3 1 3 1 7 5 3 4 3
1170+
2 1 5 1 2 1 5 1
1171+
11721172

11731173
For the example above, the problem can be stated as the two lists
11741174
[[3],[2,1],[3,2],[2,2],[6],[1,5],[6],[1],[2]] and
@@ -1205,4 +1205,4 @@ provided in the file p99-readfile.lisp. Use the predicate read_lines/2.
12051205

12061206
(3) For efficiency reasons it is important, at least for larger puzzles, to
12071207
sort the words and the sites in a particular order. For this part of the
1208-
problem, the solution of P28 may be very helpful.
1208+
problem, the solution of P28 may be very helpful.

99-problems/P01-topo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env perl6
22
use v6;
33

4-
# Use of the Whatever type to grab the last element of a list.
4+
# Use of the Whatever type to grab the last element of a list.
55

66
sub last-elem(@list)
77
{

99-problems/P02-topo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env perl6
22
use v6;
33

4-
# Further use of the Whatever type to grab the last elements of a list.
4+
# Further use of the Whatever type to grab the last elements of a list.
55

66
sub last-two(@list)
77
{

99-problems/P07-eric256.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# (1, 2, 3, 4, 5)
1010

1111

12-
sub splat (@t) {
12+
sub splat (@t) {
1313
my @return = [];
1414
for @t -> $i {
1515
if ($i.isa(Array)) {

99-problems/P08-topo.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
# It's the closest thing I can think of to a comparison function
1212
# which doesn't enforce a particular context... should be alright. :-)
1313
next if $e ~~ $last;
14-
14+
1515
$last = $e;
16-
16+
1717
take $e;
1818
}
1919
}

99-problems/P08-viklund.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# 'a' compress 'a' compress 'b' compress 'c' compress 'c' compress 'd'
2626
# The reduce metaoperator does exactly this. Example:
2727
# [+] (1,2,3,4,5) == 1 + 2 + 3 + 4 + 5 == 15
28-
# [~] <a b c d e> eq 'a' ~ 'b' ~ 'c' ~ 'd' ~ 'e' eq 'abcde'
28+
# [~] <a b c d e> eq 'a' ~ 'b' ~ 'c' ~ 'd' ~ 'e' eq 'abcde'
2929

3030
say ([compress] <a a a a b c c a a d e e e e>).perl;
3131

99-problems/P09-rje.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ sub p09
3131

3232
for @in -> $elem
3333
{
34-
push @out, [] if $elem ne @out[*-1][0];
34+
push @out, [] if $elem ne @out[*-1][0];
3535
push @out[*-1], $elem;
3636
}
3737
return @out;
3838
}
39-
39+
4040
# vim: expandtab shiftwidth=4 ft=perl6

99-problems/P09-topo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
gather while @list.elems
77
{
88
my $last = @list[0];
9-
9+
1010
take [
1111
gather while @list.elems
1212
and @list[0] ~~ $last

99-problems/P12-rhebus.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88

99
# We use the following constructs:
10-
# .map
10+
# .map
1111
# creates a modified sequence by applying the block to each element in
1212
# turn. Within the block the element is represented by $_
1313
# when expr { block }
1414
# roughly equivalent to: if $_ ~~ expr { block; next }
15-
# xx
15+
# xx
1616
# list repetition operator. (<1 2> xx 3) is the same as <1 2 1 2 1 2>
17-
# .flat
17+
# .flat
1818
# flattens a sequence. The map has constructed a sequence of Parcels:
1919
# (('a','a','a','a'),'b',('c','c'))
2020
# This sequence may be presented flat or hierarchical depending on

99-problems/P13-viklund.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
multi infix:<compress> ( $a, $b ) { $a ~~ $b ?? [[2, $a]] !! [ [1, $a], [1, $b] ] }
15-
multi infix:<compress> ( @a, $b ) {
15+
multi infix:<compress> ( @a, $b ) {
1616
if @a[*-1][1] ~~ $b {
1717
@a[*-1][0]++;
1818
return @a;

0 commit comments

Comments
 (0)