diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-05-29 20:56:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-29 20:56:29 +0100 |
| commit | 2371946c61d8d91aa26eaf9046c19346ef86dc9d (patch) | |
| tree | 1423ac56e9c40e22cc68df09e7f7007643e544c3 | |
| parent | ab9a0f978acb47861a6d676b03a18e02c0f5a4a5 (diff) | |
| parent | 9fa804b4d1e2c8e27323ef3ea7e7acea0040d690 (diff) | |
| download | perlweeklychallenge-club-2371946c61d8d91aa26eaf9046c19346ef86dc9d.tar.gz perlweeklychallenge-club-2371946c61d8d91aa26eaf9046c19346ef86dc9d.tar.bz2 perlweeklychallenge-club-2371946c61d8d91aa26eaf9046c19346ef86dc9d.zip | |
Merge pull request #4159 from arnesom/branch-for-challenge-114
Arne Sommer
| -rw-r--r-- | challenge-114/arne-sommer/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-114/arne-sommer/misc/tree1.svg | 119 | ||||
| -rw-r--r-- | challenge-114/arne-sommer/misc/tree2.svg | 109 | ||||
| -rw-r--r-- | challenge-114/arne-sommer/misc/tree3.svg | 119 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/perl/ch-1.pl | 25 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/perl/ch-2.pl | 34 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/perl/higher-integer-set-bits-perl | 34 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/perl/next-palindrome-number-perl | 25 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/raku/ch-1.raku | 14 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/raku/ch-2.raku | 22 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/raku/higher-integer-set-bits | 22 | ||||
| -rwxr-xr-x | challenge-114/arne-sommer/raku/next-palindrome-number | 14 |
12 files changed, 191 insertions, 347 deletions
diff --git a/challenge-114/arne-sommer/blog.txt b/challenge-114/arne-sommer/blog.txt new file mode 100644 index 0000000000..af28f1536f --- /dev/null +++ b/challenge-114/arne-sommer/blog.txt @@ -0,0 +1 @@ +https://raku-musings.com/palindromic-set.html diff --git a/challenge-114/arne-sommer/misc/tree1.svg b/challenge-114/arne-sommer/misc/tree1.svg deleted file mode 100644 index f0099653c7..0000000000 --- a/challenge-114/arne-sommer/misc/tree1.svg +++ /dev/null @@ -1,119 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: foogrph Pages: 1 --> -<svg width="254pt" height="212pt" - viewBox="0.00 0.00 254.00 212.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 208)"> -<title>foogrph</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-208 250,-208 250,4 -4,4"/> -<!-- node27 --> -<g id="node1" class="node"> -<title>node27</title> -<polygon fill="none" stroke="black" points="69,-180.5 69,-203.5 139,-203.5 139,-180.5 69,-180.5"/> -<text text-anchor="middle" x="79" y="-188.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="89,-180.5 89,-203.5 "/> -<text text-anchor="middle" x="104" y="-188.3" font-family="Times,serif" font-size="14.00">27</text> -<polyline fill="none" stroke="black" points="119,-180.5 119,-203.5 "/> -<text text-anchor="middle" x="129" y="-188.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node26 --> -<g id="node2" class="node"> -<title>node26</title> -<polygon fill="none" stroke="black" points="25,-120.5 25,-143.5 95,-143.5 95,-120.5 25,-120.5"/> -<text text-anchor="middle" x="35" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="45,-120.5 45,-143.5 "/> -<text text-anchor="middle" x="60" y="-128.3" font-family="Times,serif" font-size="14.00">26</text> -<polyline fill="none" stroke="black" points="75,-120.5 75,-143.5 "/> -<text text-anchor="middle" x="85" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node27->node26 --> -<g id="edge1" class="edge"> -<title>node27:left->node26:center</title> -<path fill="none" stroke="black" d="M79,-180C79,-166.01 67.63,-162.95 62.48,-153.91"/> -<polygon fill="black" stroke="black" points="65.83,-152.85 60,-144 59.04,-154.55 65.83,-152.85"/> -</g> -<!-- node25 --> -<g id="node5" class="node"> -<title>node25</title> -<polygon fill="none" stroke="black" points="113,-120.5 113,-143.5 183,-143.5 183,-120.5 113,-120.5"/> -<text text-anchor="middle" x="123" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="133,-120.5 133,-143.5 "/> -<text text-anchor="middle" x="148" y="-128.3" font-family="Times,serif" font-size="14.00">25</text> -<polyline fill="none" stroke="black" points="163,-120.5 163,-143.5 "/> -<text text-anchor="middle" x="173" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node27->node25 --> -<g id="edge4" class="edge"> -<title>node27:right->node25:center</title> -<path fill="none" stroke="black" d="M129,-180C129,-166.01 140.37,-162.95 145.52,-153.91"/> -<polygon fill="black" stroke="black" points="148.96,-154.55 148,-144 142.17,-152.85 148.96,-154.55"/> -</g> -<!-- node24 --> -<g id="node3" class="node"> -<title>node24</title> -<polygon fill="none" stroke="black" points="0,-60.5 0,-83.5 70,-83.5 70,-60.5 0,-60.5"/> -<text text-anchor="middle" x="10" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="20,-60.5 20,-83.5 "/> -<text text-anchor="middle" x="35" y="-68.3" font-family="Times,serif" font-size="14.00">24</text> -<polyline fill="none" stroke="black" points="50,-60.5 50,-83.5 "/> -<text text-anchor="middle" x="60" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node26->node24 --> -<g id="edge2" class="edge"> -<title>node26:left->node24:center</title> -<path fill="none" stroke="black" d="M35,-120C35,-108 35,-102.75 35,-94.12"/> -<polygon fill="black" stroke="black" points="38.5,-94 35,-84 31.5,-94 38.5,-94"/> -</g> -<!-- node21 --> -<g id="node4" class="node"> -<title>node21</title> -<polygon fill="none" stroke="black" points="25,-0.5 25,-23.5 95,-23.5 95,-0.5 25,-0.5"/> -<text text-anchor="middle" x="35" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="45,-0.5 45,-23.5 "/> -<text text-anchor="middle" x="60" y="-8.3" font-family="Times,serif" font-size="14.00">21</text> -<polyline fill="none" stroke="black" points="75,-0.5 75,-23.5 "/> -<text text-anchor="middle" x="85" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node24->node21 --> -<g id="edge3" class="edge"> -<title>node24:right->node21:center</title> -<path fill="none" stroke="black" d="M60,-60C60,-48 60,-42.75 60,-34.12"/> -<polygon fill="black" stroke="black" points="63.5,-34 60,-24 56.5,-34 63.5,-34"/> -</g> -<!-- node23 --> -<g id="node6" class="node"> -<title>node23</title> -<polygon fill="none" stroke="black" points="88,-60.5 88,-83.5 158,-83.5 158,-60.5 88,-60.5"/> -<text text-anchor="middle" x="98" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="108,-60.5 108,-83.5 "/> -<text text-anchor="middle" x="123" y="-68.3" font-family="Times,serif" font-size="14.00">23</text> -<polyline fill="none" stroke="black" points="138,-60.5 138,-83.5 "/> -<text text-anchor="middle" x="148" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node25->node23 --> -<g id="edge5" class="edge"> -<title>node25:left->node23:center</title> -<path fill="none" stroke="black" d="M123,-120C123,-108 123,-102.75 123,-94.12"/> -<polygon fill="black" stroke="black" points="126.5,-94 123,-84 119.5,-94 126.5,-94"/> -</g> -<!-- node22 --> -<g id="node7" class="node"> -<title>node22</title> -<polygon fill="none" stroke="black" points="176,-60.5 176,-83.5 246,-83.5 246,-60.5 176,-60.5"/> -<text text-anchor="middle" x="186" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="196,-60.5 196,-83.5 "/> -<text text-anchor="middle" x="211" y="-68.3" font-family="Times,serif" font-size="14.00">22</text> -<polyline fill="none" stroke="black" points="226,-60.5 226,-83.5 "/> -<text text-anchor="middle" x="236" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node25->node22 --> -<g id="edge6" class="edge"> -<title>node25:right->node22:center</title> -<path fill="none" stroke="black" d="M173,-120C173,-100.92 198.57,-104.57 207.76,-93.66"/> -<polygon fill="black" stroke="black" points="211.14,-94.59 211,-84 204.5,-92.37 211.14,-94.59"/> -</g> -</g> -</svg> diff --git a/challenge-114/arne-sommer/misc/tree2.svg b/challenge-114/arne-sommer/misc/tree2.svg deleted file mode 100644 index a52f38f373..0000000000 --- a/challenge-114/arne-sommer/misc/tree2.svg +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: foogrph Pages: 1 --> -<svg width="273pt" height="152pt" - viewBox="0.00 0.00 273.00 152.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 148)"> -<title>foogrph</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-148 269,-148 269,4 -4,4"/> -<!-- node21 --> -<g id="node1" class="node"> -<title>node21</title> -<polygon fill="none" stroke="black" points="78,-120.5 78,-143.5 148,-143.5 148,-120.5 78,-120.5"/> -<text text-anchor="middle" x="88" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="98,-120.5 98,-143.5 "/> -<text text-anchor="middle" x="113" y="-128.3" font-family="Times,serif" font-size="14.00">21</text> -<polyline fill="none" stroke="black" points="128,-120.5 128,-143.5 "/> -<text text-anchor="middle" x="138" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node20 --> -<g id="node2" class="node"> -<title>node20</title> -<polygon fill="none" stroke="black" points="15,-60.5 15,-83.5 85,-83.5 85,-60.5 15,-60.5"/> -<text text-anchor="middle" x="25" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="35,-60.5 35,-83.5 "/> -<text text-anchor="middle" x="50" y="-68.3" font-family="Times,serif" font-size="14.00">20</text> -<polyline fill="none" stroke="black" points="65,-60.5 65,-83.5 "/> -<text text-anchor="middle" x="75" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node21->node20 --> -<g id="edge1" class="edge"> -<title>node21:left->node20:center</title> -<path fill="none" stroke="black" d="M88,-120C88,-100.92 62.43,-104.57 53.24,-93.66"/> -<polygon fill="black" stroke="black" points="56.5,-92.37 50,-84 49.86,-94.59 56.5,-92.37"/> -</g> -<!-- node19 --> -<g id="node4" class="node"> -<title>node19</title> -<polygon fill="none" stroke="black" points="141,-60.5 141,-83.5 211,-83.5 211,-60.5 141,-60.5"/> -<text text-anchor="middle" x="151" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="161,-60.5 161,-83.5 "/> -<text text-anchor="middle" x="176" y="-68.3" font-family="Times,serif" font-size="14.00">19</text> -<polyline fill="none" stroke="black" points="191,-60.5 191,-83.5 "/> -<text text-anchor="middle" x="201" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node21->node19 --> -<g id="edge4" class="edge"> -<title>node21:right->node19:center</title> -<path fill="none" stroke="black" d="M138,-120C138,-100.92 163.57,-104.57 172.76,-93.66"/> -<polygon fill="black" stroke="black" points="176.14,-94.59 176,-84 169.5,-92.37 176.14,-94.59"/> -</g> -<!-- node18 --> -<g id="node3" class="node"> -<title>node18</title> -<polygon fill="none" stroke="black" points="0,-0.5 0,-23.5 70,-23.5 70,-0.5 0,-0.5"/> -<text text-anchor="middle" x="10" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="20,-0.5 20,-23.5 "/> -<text text-anchor="middle" x="35" y="-8.3" font-family="Times,serif" font-size="14.00">18</text> -<polyline fill="none" stroke="black" points="50,-0.5 50,-23.5 "/> -<text text-anchor="middle" x="60" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node20->node18 --> -<g id="edge2" class="edge"> -<title>node20:left->node18:center</title> -<path fill="none" stroke="black" d="M25,-60C25,-47.42 30.74,-42.77 33.52,-34.03"/> -<polygon fill="black" stroke="black" points="37.01,-34.4 35,-24 30.08,-33.38 37.01,-34.4"/> -</g> -<!-- node18->node21 --> -<g id="edge3" class="edge"> -<title>node18:right->node21:center</title> -<path fill="none" stroke="black" d="M60,-24C60,-46.01 82.84,-41.03 94,-60 106.3,-80.91 111.56,-89.64 112.73,-109.83"/> -<polygon fill="black" stroke="black" points="109.24,-110.09 113,-120 116.24,-109.91 109.24,-110.09"/> -</g> -<!-- node17 --> -<g id="node5" class="node"> -<title>node17</title> -<polygon fill="none" stroke="black" points="107,-0.5 107,-23.5 177,-23.5 177,-0.5 107,-0.5"/> -<text text-anchor="middle" x="117" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="127,-0.5 127,-23.5 "/> -<text text-anchor="middle" x="142" y="-8.3" font-family="Times,serif" font-size="14.00">17</text> -<polyline fill="none" stroke="black" points="157,-0.5 157,-23.5 "/> -<text text-anchor="middle" x="167" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node19->node17 --> -<g id="edge5" class="edge"> -<title>node19:left->node17:center</title> -<path fill="none" stroke="black" d="M151,-60C151,-47.5 145.83,-42.74 143.33,-33.99"/> -<polygon fill="black" stroke="black" points="146.79,-33.45 142,-24 139.85,-34.37 146.79,-33.45"/> -</g> -<!-- node16 --> -<g id="node6" class="node"> -<title>node16</title> -<polygon fill="none" stroke="black" points="195,-0.5 195,-23.5 265,-23.5 265,-0.5 195,-0.5"/> -<text text-anchor="middle" x="205" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="215,-0.5 215,-23.5 "/> -<text text-anchor="middle" x="230" y="-8.3" font-family="Times,serif" font-size="14.00">16</text> -<polyline fill="none" stroke="black" points="245,-0.5 245,-23.5 "/> -<text text-anchor="middle" x="255" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node19->node16 --> -<g id="edge6" class="edge"> -<title>node19:right->node16:center</title> -<path fill="none" stroke="black" d="M201,-60C201,-43.63 219.42,-43.54 226.9,-33.78"/> -<polygon fill="black" stroke="black" points="230.31,-34.59 230,-24 223.64,-32.47 230.31,-34.59"/> -</g> -</g> -</svg> diff --git a/challenge-114/arne-sommer/misc/tree3.svg b/challenge-114/arne-sommer/misc/tree3.svg deleted file mode 100644 index 008b0f8d4e..0000000000 --- a/challenge-114/arne-sommer/misc/tree3.svg +++ /dev/null @@ -1,119 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: foogrph Pages: 1 --> -<svg width="254pt" height="212pt" - viewBox="0.00 0.00 254.00 212.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 208)"> -<title>foogrph</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-208 250,-208 250,4 -4,4"/> -<!-- node94557370778344 --> -<g id="node1" class="node"> -<title>node94557370778344</title> -<polygon fill="none" stroke="black" points="69,-180.5 69,-203.5 139,-203.5 139,-180.5 69,-180.5"/> -<text text-anchor="middle" x="79" y="-188.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="89,-180.5 89,-203.5 "/> -<text text-anchor="middle" x="104" y="-188.3" font-family="Times,serif" font-size="14.00">21</text> -<polyline fill="none" stroke="black" points="119,-180.5 119,-203.5 "/> -<text text-anchor="middle" x="129" y="-188.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node94557370778232 --> -<g id="node2" class="node"> -<title>node94557370778232</title> -<polygon fill="none" stroke="black" points="25,-120.5 25,-143.5 95,-143.5 95,-120.5 25,-120.5"/> -<text text-anchor="middle" x="35" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="45,-120.5 45,-143.5 "/> -<text text-anchor="middle" x="60" y="-128.3" font-family="Times,serif" font-size="14.00">20</text> -<polyline fill="none" stroke="black" points="75,-120.5 75,-143.5 "/> -<text text-anchor="middle" x="85" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node94557370778344->node94557370778232 --> -<g id="edge1" class="edge"> -<title>node94557370778344:left->node94557370778232:center</title> -<path fill="none" stroke="black" d="M79,-180C79,-166.01 67.63,-162.95 62.48,-153.91"/> -<polygon fill="black" stroke="black" points="65.83,-152.85 60,-144 59.04,-154.55 65.83,-152.85"/> -</g> -<!-- node94557370778288 --> -<g id="node5" class="node"> -<title>node94557370778288</title> -<polygon fill="none" stroke="black" points="113,-120.5 113,-143.5 183,-143.5 183,-120.5 113,-120.5"/> -<text text-anchor="middle" x="123" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="133,-120.5 133,-143.5 "/> -<text text-anchor="middle" x="148" y="-128.3" font-family="Times,serif" font-size="14.00">19</text> -<polyline fill="none" stroke="black" points="163,-120.5 163,-143.5 "/> -<text text-anchor="middle" x="173" y="-128.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node94557370778344->node94557370778288 --> -<g id="edge4" class="edge"> -<title>node94557370778344:right->node94557370778288:center</title> -<path fill="none" stroke="black" d="M129,-180C129,-166.01 140.37,-162.95 145.52,-153.91"/> -<polygon fill="black" stroke="black" points="148.96,-154.55 148,-144 142.17,-152.85 148.96,-154.55"/> -</g> -<!-- node94557370778064 --> -<g id="node3" class="node"> -<title>node94557370778064</title> -<polygon fill="none" stroke="black" points="0,-60.5 0,-83.5 70,-83.5 70,-60.5 0,-60.5"/> -<text text-anchor="middle" x="10" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="20,-60.5 20,-83.5 "/> -<text text-anchor="middle" x="35" y="-68.3" font-family="Times,serif" font-size="14.00">18</text> -<polyline fill="none" stroke="black" points="50,-60.5 50,-83.5 "/> -<text text-anchor="middle" x="60" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node94557370778232->node94557370778064 --> -<g id="edge2" class="edge"> -<title>node94557370778232:left->node94557370778064:center</title> -<path fill="none" stroke="black" d="M35,-120C35,-108 35,-102.75 35,-94.12"/> -<polygon fill="black" stroke="black" points="38.5,-94 35,-84 31.5,-94 38.5,-94"/> -</g> -<!-- node94557370778008 --> -<g id="node4" class="node"> -<title>node94557370778008</title> -<polygon fill="none" stroke="black" points="25,-0.5 25,-23.5 95,-23.5 95,-0.5 25,-0.5"/> -<text text-anchor="middle" x="35" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="45,-0.5 45,-23.5 "/> -<text text-anchor="middle" x="60" y="-8.3" font-family="Times,serif" font-size="14.00">21</text> -<polyline fill="none" stroke="black" points="75,-0.5 75,-23.5 "/> -<text text-anchor="middle" x="85" y="-8.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node94557370778064->node94557370778008 --> -<g id="edge3" class="edge"> -<title>node94557370778064:right->node94557370778008:center</title> -<path fill="none" stroke="black" d="M60,-60C60,-48 60,-42.75 60,-34.12"/> -<polygon fill="black" stroke="black" points="63.5,-34 60,-24 56.5,-34 63.5,-34"/> -</g> -<!-- node94557370778120 --> -<g id="node6" class="node"> -<title>node94557370778120</title> -<polygon fill="none" stroke="black" points="88,-60.5 88,-83.5 158,-83.5 158,-60.5 88,-60.5"/> -<text text-anchor="middle" x="98" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="108,-60.5 108,-83.5 "/> -<text text-anchor="middle" x="123" y="-68.3" font-family="Times,serif" font-size="14.00">17</text> -<polyline fill="none" stroke="black" points="138,-60.5 138,-83.5 "/> -<text text-anchor="middle" x="148" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node94557370778288->node94557370778120 --> -<g id="edge5" class="edge"> -<title>node94557370778288:left->node94557370778120:center</title> -<path fill="none" stroke="black" d="M123,-120C123,-108 123,-102.75 123,-94.12"/> -<polygon fill="black" stroke="black" points="126.5,-94 123,-84 119.5,-94 126.5,-94"/> -</g> -<!-- node94557370778176 --> -<g id="node7" class="node"> -<title>node94557370778176</title> -<polygon fill="none" stroke="black" points="176,-60.5 176,-83.5 246,-83.5 246,-60.5 176,-60.5"/> -<text text-anchor="middle" x="186" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -<polyline fill="none" stroke="black" points="196,-60.5 196,-83.5 "/> -<text text-anchor="middle" x="211" y="-68.3" font-family="Times,serif" font-size="14.00">16</text> -<polyline fill="none" stroke="black" points="226,-60.5 226,-83.5 "/> -<text text-anchor="middle" x="236" y="-68.3" font-family="Times,serif" font-size="14.00"> </text> -</g> -<!-- node94557370778288->node94557370778176 --> -<g id="edge6" class="edge"> -<title>node94557370778288:right->node94557370778176:center</title> -<path fill="none" stroke="black" d="M173,-120C173,-100.92 198.57,-104.57 207.76,-93.66"/> -<polygon fill="black" stroke="black" points="211.14,-94.59 211,-84 204.5,-92.37 211.14,-94.59"/> -</g> -</g> -</svg> diff --git a/challenge-114/arne-sommer/perl/ch-1.pl b/challenge-114/arne-sommer/perl/ch-1.pl new file mode 100755 index 0000000000..6ccfbb6a95 --- /dev/null +++ b/challenge-114/arne-sommer/perl/ch-1.pl @@ -0,0 +1,25 @@ +#! /usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; +use Getopt::Long; + +my $verbose = 0; + +GetOptions("verbose" => \$verbose); + +my $N = $ARGV[0] // die "Specify a positive integer"; + +die "Not a positive integer" unless $N =~ /^[1-9]\d*$/; + +while ($N++) +{ + say ": Candidate $N" if $verbose; + + if ($N eq reverse($N)) + { + say $N; + exit; + } +} diff --git a/challenge-114/arne-sommer/perl/ch-2.pl b/challenge-114/arne-sommer/perl/ch-2.pl new file mode 100755 index 0000000000..7acfb04260 --- /dev/null +++ b/challenge-114/arne-sommer/perl/ch-2.pl @@ -0,0 +1,34 @@ +#! /usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; +use List::Util qw/sum/; +use Getopt::Long; + +my $verbose = 0; + +GetOptions("verbose" => \$verbose); + +my $N = $ARGV[0] // die "Specify a positive integer"; + +die "Not a positive integer" unless $N =~ /^[1-9]\d*$/; + +my $ones = sum(split(//, sprintf('%b', $N))); + +if ($verbose) +{ + say ": Initial value: $N (binary: ", sprintf('%b', $N) , ")"; + say ": - Number of one bits: $ones"; +} + +while ($N += 1) +{ + say ": Candidate $N (binary: ", sprintf('%b', $N), ")" if $verbose; + + if (sum(split(//, sprintf('%b', $N))) == $ones) + { + say $N; + exit; + } +} diff --git a/challenge-114/arne-sommer/perl/higher-integer-set-bits-perl b/challenge-114/arne-sommer/perl/higher-integer-set-bits-perl new file mode 100755 index 0000000000..7acfb04260 --- /dev/null +++ b/challenge-114/arne-sommer/perl/higher-integer-set-bits-perl @@ -0,0 +1,34 @@ +#! /usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; +use List::Util qw/sum/; +use Getopt::Long; + +my $verbose = 0; + +GetOptions("verbose" => \$verbose); + +my $N = $ARGV[0] // die "Specify a positive integer"; + +die "Not a positive integer" unless $N =~ /^[1-9]\d*$/; + +my $ones = sum(split(//, sprintf('%b', $N))); + +if ($verbose) +{ + say ": Initial value: $N (binary: ", sprintf('%b', $N) , ")"; + say ": - Number of one bits: $ones"; +} + +while ($N += 1) +{ + say ": Candidate $N (binary: ", sprintf('%b', $N), ")" if $verbose; + + if (sum(split(//, sprintf('%b', $N))) == $ones) + { + say $N; + exit; + } +} diff --git a/challenge-114/arne-sommer/perl/next-palindrome-number-perl b/challenge-114/arne-sommer/perl/next-palindrome-number-perl new file mode 100755 index 0000000000..6ccfbb6a95 --- /dev/null +++ b/challenge-114/arne-sommer/perl/next-palindrome-number-perl @@ -0,0 +1,25 @@ +#! /usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; +use Getopt::Long; + +my $verbose = 0; + +GetOptions("verbose" => \$verbose); + +my $N = $ARGV[0] // die "Specify a positive integer"; + +die "Not a positive integer" unless $N =~ /^[1-9]\d*$/; + +while ($N++) +{ + say ": Candidate $N" if $verbose; + + if ($N eq reverse($N)) + { + say $N; + exit; + } +} diff --git a/challenge-114/arne-sommer/raku/ch-1.raku b/challenge-114/arne-sommer/raku/ch-1.raku new file mode 100755 index 0000000000..1d1da44353 --- /dev/null +++ b/challenge-114/arne-sommer/raku/ch-1.raku @@ -0,0 +1,14 @@ +#! /usr/bin/env raku + +unit sub MAIN (Int $N where $N > 0, :v($verbose)); + +for $N + 1 .. Inf -> $candidate +{ + say ": Candidate $candidate" if $verbose; + + if $candidate eq $candidate.flip + { + say $candidate; + exit; + } +} diff --git a/challenge-114/arne-sommer/raku/ch-2.raku b/challenge-114/arne-sommer/raku/ch-2.raku new file mode 100755 index 0000000000..893a91ad5a --- /dev/null +++ b/challenge-114/arne-sommer/raku/ch-2.raku @@ -0,0 +1,22 @@ +#! /usr/bin/env raku + +unit sub MAIN (Int $N where $N > 0, :v($verbose)); + +my $ones = $N.fmt('%b').comb.sum; + +if $verbose +{ + say ": Initial value: $N (binary: { $N.fmt('%b') })"; + say ": - Number of one bits: $ones"; +} + +for $N + 1 .. Inf -> $candidate +{ + say ": Candidate $candidate (binary: { $candidate.fmt('%b') })" if $verbose; + + if $candidate.fmt('%b').comb.sum == $ones + { + say $candidate; + exit; + } +} diff --git a/challenge-114/arne-sommer/raku/higher-integer-set-bits b/challenge-114/arne-sommer/raku/higher-integer-set-bits new file mode 100755 index 0000000000..893a91ad5a --- /dev/null +++ b/challenge-114/arne-sommer/raku/higher-integer-set-bits @@ -0,0 +1,22 @@ +#! /usr/bin/env raku + +unit sub MAIN (Int $N where $N > 0, :v($verbose)); + +my $ones = $N.fmt('%b').comb.sum; + +if $verbose +{ + say ": Initial value: $N (binary: { $N.fmt('%b') })"; + say ": - Number of one bits: $ones"; +} + +for $N + 1 .. Inf -> $candidate +{ + say ": Candidate $candidate (binary: { $candidate.fmt('%b') })" if $verbose; + + if $candidate.fmt('%b').comb.sum == $ones + { + say $candidate; + exit; + } +} diff --git a/challenge-114/arne-sommer/raku/next-palindrome-number b/challenge-114/arne-sommer/raku/next-palindrome-number new file mode 100755 index 0000000000..1d1da44353 --- /dev/null +++ b/challenge-114/arne-sommer/raku/next-palindrome-number @@ -0,0 +1,14 @@ +#! /usr/bin/env raku + +unit sub MAIN (Int $N where $N > 0, :v($verbose)); + +for $N + 1 .. Inf -> $candidate +{ + say ": Candidate $candidate" if $verbose; + + if $candidate eq $candidate.flip + { + say $candidate; + exit; + } +} |
