From e7ac85a1fd02d06401caccf9da639c6fa1ca3774 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 3 Aug 2020 04:44:56 +0100 Subject: - Added template for Challenge 072. --- challenge-072/ash/README | 1 + 1 file changed, 1 insertion(+) create mode 100644 challenge-072/ash/README (limited to 'challenge-072/ash') diff --git a/challenge-072/ash/README b/challenge-072/ash/README new file mode 100644 index 0000000000..318b1bfb41 --- /dev/null +++ b/challenge-072/ash/README @@ -0,0 +1 @@ +Solutions by Andrew Shitov -- cgit From 8f239de9ed7bd532eda8f33702cecc5443b6d086 Mon Sep 17 00:00:00 2001 From: Andrew Shitov Date: Tue, 4 Aug 2020 15:11:58 +0300 Subject: ash 072 --- challenge-072/ash/blog.txt | 1 + challenge-072/ash/raku/ch-1.raku | 14 ++++++++++++++ challenge-072/ash/raku/ch-2.raku | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 challenge-072/ash/blog.txt create mode 100644 challenge-072/ash/raku/ch-1.raku create mode 100644 challenge-072/ash/raku/ch-2.raku (limited to 'challenge-072/ash') diff --git a/challenge-072/ash/blog.txt b/challenge-072/ash/blog.txt new file mode 100644 index 0000000000..9f021f2e94 --- /dev/null +++ b/challenge-072/ash/blog.txt @@ -0,0 +1 @@ +https://andrewshitov.com/2020/08/04/raku-challenge-week-72/ diff --git a/challenge-072/ash/raku/ch-1.raku b/challenge-072/ash/raku/ch-1.raku new file mode 100644 index 0000000000..24387f4f87 --- /dev/null +++ b/challenge-072/ash/raku/ch-1.raku @@ -0,0 +1,14 @@ +#!/usr/bin/env raku + +# Task 1 from +# https://perlweeklychallenge.org/blog/perl-weekly-challenge-072/ + +# Comments: https://andrewshitov.com/2020/08/04/raku-challenge-week-72/ + +unit sub MAIN(Int $n); + +my $f = [*] 1..$n; +say "$n! = $f"; +# $f ~~ / 0+! $/; +# say ($f ~~ / 0+ $/).chars; +say ($f ~~ / 0+ $/ // '').chars; diff --git a/challenge-072/ash/raku/ch-2.raku b/challenge-072/ash/raku/ch-2.raku new file mode 100644 index 0000000000..51b409ab5b --- /dev/null +++ b/challenge-072/ash/raku/ch-2.raku @@ -0,0 +1,13 @@ +#!/usr/bin/env raku + +# Task 2 from +# https://perlweeklychallenge.org/blog/perl-weekly-challenge-072/ + +# Comments: https://andrewshitov.com/2020/08/04/raku-challenge-week-72/ + +# Generating input.txt: +# $ raku -e'say "L$_" for 1..100' > input.txt + +unit sub MAIN(Int $a, Int $b where 0 < $a <= $b <= 100); + +.say for 'input.txt'.IO.lines[$a-1 ..^ $b]; -- cgit