diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-08-04 18:51:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-04 18:51:00 +0100 |
| commit | 760909544041922b6181ab3888e8f4e10056e9dc (patch) | |
| tree | 2170e9b371852313b686e4ce76d5f52adc039f75 | |
| parent | 2a666cfcaf61b6708bfcf9df02c31b4e104a4205 (diff) | |
| parent | a323d493970519f925c7874509479abdc0e5f459 (diff) | |
| download | perlweeklychallenge-club-760909544041922b6181ab3888e8f4e10056e9dc.tar.gz perlweeklychallenge-club-760909544041922b6181ab3888e8f4e10056e9dc.tar.bz2 perlweeklychallenge-club-760909544041922b6181ab3888e8f4e10056e9dc.zip | |
Merge pull request #467 from fjwhittle/master
fjwhittle challenge 019 solutions and blog.
| -rw-r--r-- | challenge-019/fjwhittle/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-019/fjwhittle/perl6/brlipsum.txt | 14 | ||||
| -rw-r--r-- | challenge-019/fjwhittle/perl6/ch-1.p6 | 5 | ||||
| -rw-r--r-- | challenge-019/fjwhittle/perl6/ch-2.p6 | 15 |
4 files changed, 35 insertions, 0 deletions
diff --git a/challenge-019/fjwhittle/blog.txt b/challenge-019/fjwhittle/blog.txt new file mode 100644 index 0000000000..bd36367934 --- /dev/null +++ b/challenge-019/fjwhittle/blog.txt @@ -0,0 +1 @@ +https://rage.powered.ninja/2019/07/29/best-months.html diff --git a/challenge-019/fjwhittle/perl6/brlipsum.txt b/challenge-019/fjwhittle/perl6/brlipsum.txt new file mode 100644 index 0000000000..03615291c9 --- /dev/null +++ b/challenge-019/fjwhittle/perl6/brlipsum.txt @@ -0,0 +1,14 @@ +That's what painting is all about. It should make you feel good when you paint. The least little bit can do so much. All you have to do is let your imagination go wild. Painting should do one thing. It should put happiness in your heart. Talent is a pursued interest. That is to say, anything you practice you can do. Everybody needs a friend.
+
+Nothing's gonna make your husband or wife madder than coming home and having a snow-covered dinner. Let's put some happy little clouds in our world. We'll put some happy little leaves here and there. This is a fantastic little painting. That easy. Without washing the brush, I'm gonna go right into some Van Dyke Brown, some Burnt Umber, and a little bit of Sap Green.
+
+If you didn't have baby clouds, you wouldn't have big clouds. You can get away with a lot. You have to make these big decisions. I want everbody to be happy. That's what it's all about. There's not a thing in the world wrong with washing your brush.
+
+Just make a decision and let it go. That's a crooked tree. We'll send him to Washington. This is a happy place, little squirrels live here and play. This is truly an almighty mountain. You got your heavy coat out yet? It's getting colder. That's why I paint - because I can create the kind of world I want - and I can make this world as happy as I want it.
+
+Isn't that fantastic that you can make whole mountains in minutes? If there's two big trees invariably sooner or later there's gonna be a little tree. The little tiny Tim easels will let you down. Don't forget to tell these special people in your life just how special they are to you.
+
+You can do anything here. So don't worry about it. If we're gonna walk though the woods, we need a little path. It's amazing what you can do with a little love in your heart.
+
+We're trying to teach you a technique here and how to use it. Now it's beginning to make a little sense. Exercising the imagination, experimenting with talents, being creative; these things, to me, are truly the windows to your soul.
+
diff --git a/challenge-019/fjwhittle/perl6/ch-1.p6 b/challenge-019/fjwhittle/perl6/ch-1.p6 new file mode 100644 index 0000000000..ff3e6dc947 --- /dev/null +++ b/challenge-019/fjwhittle/perl6/ch-1.p6 @@ -0,0 +1,5 @@ +my enum Month «:1January February March April May June July August September October November December»; + +(Date.new('1900-01-01'), *.later(:1month) ... Date.new('2019-12-01')).\ + grep({.day-of-week == 5 and .days-in-month == 31}).\ + map({"{Month(.month)} {.year}"})».say; diff --git a/challenge-019/fjwhittle/perl6/ch-2.p6 b/challenge-019/fjwhittle/perl6/ch-2.p6 new file mode 100644 index 0000000000..560c5c5ed0 --- /dev/null +++ b/challenge-019/fjwhittle/perl6/ch-2.p6 @@ -0,0 +1,15 @@ +#!/usr/bin/env perl6 + +#| Wrap the given file at the specified column using the greedy +#| algorithm. +unit sub MAIN( + IO(Str) $file?, #= File to wrap. Defaults to standard input. + UInt :c(:$column) = 80 #= Column to wrap at. Defaults to 80. +); + +($file // $*IN).comb(/ || )> \s *? \n + || <-[ \n ]> ** { 1..($column-1) } \S )> + <?before [ \s || $ ]> <[ \s ] - [ \n ]>* \n ? + || \S ** { $column } + /)».put; + |
