diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2020-07-19 14:00:13 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2020-07-19 14:00:13 +0100 |
| commit | 6a154071813b4fbbba8cd08dcd6f2ba3f909b63b (patch) | |
| tree | 50291ba599093aa2a19e464a5825bbaf2d8ac0b2 /challenge-069 | |
| parent | 988dfbcfb47f123fb439b1cd672c31f411afc53f (diff) | |
| download | perlweeklychallenge-club-6a154071813b4fbbba8cd08dcd6f2ba3f909b63b.tar.gz perlweeklychallenge-club-6a154071813b4fbbba8cd08dcd6f2ba3f909b63b.tar.bz2 perlweeklychallenge-club-6a154071813b4fbbba8cd08dcd6f2ba3f909b63b.zip | |
- Added solutions by Richard Park.
Diffstat (limited to 'challenge-069')
| -rw-r--r-- | challenge-069/richard-park/apl/StrobogrammaticNumber.aplf | 7 | ||||
| -rw-r--r-- | challenge-069/richard-park/apl/ZeroOneString.aplf | 10 | ||||
| -rw-r--r-- | challenge-069/richard-park/apl/ch-1.aplf | 7 | ||||
| -rw-r--r-- | challenge-069/richard-park/apl/ch-2.aplf | 10 | ||||
| -rw-r--r-- | challenge-069/richard-park/blog.txt | 1 |
5 files changed, 35 insertions, 0 deletions
diff --git a/challenge-069/richard-park/apl/StrobogrammaticNumber.aplf b/challenge-069/richard-park/apl/StrobogrammaticNumber.aplf new file mode 100644 index 0000000000..6076928cec --- /dev/null +++ b/challenge-069/richard-park/apl/StrobogrammaticNumber.aplf @@ -0,0 +1,7 @@ + StrobogrammaticNumber←{ +⍝ ←: Numbers between ⍺ and ⍵ which look the same +⍝ when rotated 180° e.g. 68089 + ⎕IO←0 + n←⍺+⍳1+⍵-⍺ + n⌿⍨'015__29_86'∘{⍵≡⌽⍺[⍎¨⍵]}¨⍕¨n + } diff --git a/challenge-069/richard-park/apl/ZeroOneString.aplf b/challenge-069/richard-park/apl/ZeroOneString.aplf new file mode 100644 index 0000000000..b6e3615d3a --- /dev/null +++ b/challenge-069/richard-park/apl/ZeroOneString.aplf @@ -0,0 +1,10 @@ + ZeroOneString←{ +⍝ ←: ⍵th number in the series defined as follows +⍝ (S 0) = '' ⋄ (S 1) = '0' ⋄ (S ⍵) = (S ⍵-1),'0',~⌽S ⍵-1 + S←{ + ⍵=0:⍬ + p←∇ ⍵-1 + p,0,~⌽p + } + (⍕S ⍵)~' ' + } diff --git a/challenge-069/richard-park/apl/ch-1.aplf b/challenge-069/richard-park/apl/ch-1.aplf new file mode 100644 index 0000000000..6076928cec --- /dev/null +++ b/challenge-069/richard-park/apl/ch-1.aplf @@ -0,0 +1,7 @@ + StrobogrammaticNumber←{ +⍝ ←: Numbers between ⍺ and ⍵ which look the same +⍝ when rotated 180° e.g. 68089 + ⎕IO←0 + n←⍺+⍳1+⍵-⍺ + n⌿⍨'015__29_86'∘{⍵≡⌽⍺[⍎¨⍵]}¨⍕¨n + } diff --git a/challenge-069/richard-park/apl/ch-2.aplf b/challenge-069/richard-park/apl/ch-2.aplf new file mode 100644 index 0000000000..b6e3615d3a --- /dev/null +++ b/challenge-069/richard-park/apl/ch-2.aplf @@ -0,0 +1,10 @@ + ZeroOneString←{ +⍝ ←: ⍵th number in the series defined as follows +⍝ (S 0) = '' ⋄ (S 1) = '0' ⋄ (S ⍵) = (S ⍵-1),'0',~⌽S ⍵-1 + S←{ + ⍵=0:⍬ + p←∇ ⍵-1 + p,0,~⌽p + } + (⍕S ⍵)~' ' + } diff --git a/challenge-069/richard-park/blog.txt b/challenge-069/richard-park/blog.txt new file mode 100644 index 0000000000..49a7dc1b29 --- /dev/null +++ b/challenge-069/richard-park/blog.txt @@ -0,0 +1 @@ +https://www.youtube.com/watch?v=GN3nHJzF-qA |
