The Weekly Challenge - 240

Monday, Oct 23, 2023| Tags: Perl, Raku

TABLE OF CONTENTS


01. HEADLINES

02. SPONSOR

03. RECAP

04. PERL REVIEW

05. RAKU REVIEW

06. CHART

07. NEW MEMBERS

08. GUESTS

09. TASK #1: Acronym

10. TASK #2: Build Array


HEADLINES


Welcome to the Week #240 of The Weekly Challenge.

Let us all welcome Raghu R., lacek96 and Magnus Markling to the Team PWC.

We now have 300 regular contributors and 20 guest contributors.

A new guest language Uiua is introduced by two guest contributors Conor Hoekstra and Magnus Markling.

Adam Russell has been a regular contributor in Prolog but now we have one more contributor Raghu R.

We now have contributions in 105 guest languages. All credit goes to the Team PWC.

Last 5 weeks mainstream contribution stats. Thank you Team PWC for your support and encouragements.

  Week      Perl       Raku       Blog   
   235       61       34       24   
   236       51       34       29   
   237       48       34       26   
   238       60       37       29   
   239       59       41       28   

Last 5 weeks guest contribution stats. Thank you each and every guest contributors for your time and efforts.

  Week      Guests       Contributions       Languages   
   235       14       78       23   
   236       14       62       20   
   237       14       54       16   
   238       15       79       24   
   239       20       84       24   

TOP 10 Guest Languages


Rust jumped one position up to rank #5, congratulations all Rust contributors.

Do you see your favourite language in the Top 10? If not then why not contribute regularly and make it to the top.

 1. Python     (1909)
 2. Ruby       (609)
 3. Haskell    (600)
 4. Lua        (532)
 5. Rust       (449)
 6. C          (445)
 7. C++        (417)
 8. BQN        (311)
 9. Go         (285)
10. JavaScript (277)

Blogs with Creative Title


1. Let’s Functionalize the #$%@# Out of This One by Augie De Blieck Jr.

2. Nothing But Strings by Arne Sommer.

3. Adagio for frayed knots by Bob Lied.

4. arrays, grep and nested loops by Luca Ferrari.

5. Short Solutions for Short Strings by Matthias Muth.

6. Now it’s the same old string, but with consistency since you’ve been gone… by Packy Anderson.

7. Pulling the strings by Peter Campbell Smith.

8. Same and Consistent by Roger Bell_West.

9. The one about regular expressions by Simon Green.


GitHub Repository Stats


1. Commits: 34,775 (+124)

2. Pull Requests: 8,910 (+50)

3. Contributors: 237 (+3)

4. Fork: 298 (+3)

5. Stars: 165 (+1)


rcmlz prepared report based on PR #8644 for the Week #239


Raku Benchmark Scabality


nice raku --optimize=3 -I challenge-nr239 -- test/benchmark-scalability.raku \
          --out-folder=/tmp --v=True --max-problem=20 --max-run-times=1 nr239

Task 1

+-----------------+---------+---------+-------------+-------------+
| user            | runtime | n       | latency     | total       |
+-----------------+---------+---------+-------------+-------------+
| jaldhar-h-vyas  | 1       | 4194304 | 0.77310626  | 0.773202246 |
| luca-ferrari    | 1       | 4194304 | 0.942182681 | 0.942326202 |
| arne-sommer     | 1       | 2097152 | 0.593676208 | 0.593763191 |
| mark-anderson   | 1       | 2097152 | 0.655711438 | 0.655811141 |
| rcmlz           | 1       | 2097152 | 0.894959085 | 0.895183207 |
| polettix        | 1       | 2097152 | 0.941968599 | 0.942073468 |
| robert-dicicco  | 1       | 1048576 | 0.460632281 | 0.460793367 |
| massa           | 1       | 1048576 | 0.473441587 | 0.473588072 |
| Orir            | 1       | 1048576 | 0.524670937 | 0.524782313 |
| deadmarshal     | 1       | 524288  | 0.107902088 | 0.107995878 |
| roger-bell-west | 1       | 262144  | 0.161498102 | 0.161604332 |
| lubos-kolouch   | 1       | 262144  | 0.182740955 | 0.182853641 |
| ianrifkin       | 1       | 262144  | 0.574145717 | 0.574235421 |
| razetime        | 1       | 131072  | 0.602414003 | 0.60250614  |
| ulrich-rieke    | 1       | 131072  | 0.789299854 | 0.789403569 |
| packy-anderson  | 1       | 65536   | 0.532932217 | 0.533019797 |
+-----------------+---------+---------+-------------+-------------+

Task 2

+-----------------+---------+---------+-------------+-------------+
| user            | runtime | n       | latency     | total       |
+-----------------+---------+---------+-------------+-------------+
| Orir            | 1       | 65537   | 0.932379319 | 0.932468012 |
| rcmlz           | 1       | 65537   | 0.877091269 | 0.947184198 |
| ulrich-rieke    | 1       | 32769   | 0.525065623 | 0.525172039 |
| ianrifkin       | 1       | 32769   | 0.590588167 | 0.590690035 |
| mark-anderson   | 1       | 32769   | 0.815500792 | 0.815606858 |
| deadmarshal     | 1       | 32769   | 0.816356929 | 0.816461956 |
| jaldhar-h-vyas  | 1       | 32769   | 0.854262112 | 0.854467136 |
| arne-sommer     | 1       | 32769   | 0.94208156  | 0.942195192 |
| roger-bell-west | 1       | 16385   | 0.550407914 | 0.550497904 |
| razetime        | 1       | 16385   | 0.572822602 | 0.572923979 |
| packy-anderson  | 1       | 16385   | 0.630611837 | 0.630717287 |
| lubos-kolouch   | 1       | 16385   | 0.725875646 | 0.725966264 |
| polettix        | 1       | 4097    | 0.036932124 | 0.037044476 |
| massa           | 1       | 4097    | 0.314405963 | 0.314510898 |
| luca-ferrari    | 1       | 4097    | 0.407525907 | 0.407615693 |
+-----------------+---------+---------+-------------+-------------+

Breakdown by Languages

tokei -f --sort code --columns=130

==================================================================================================================================
 Language                                                               Files        Lines         Code     Comments       Blanks
==================================================================================================================================
 Perl                                                                      50         2706         1542          708          456
----------------------------------------------------------------------------------------------------------------------------------
 athanasius/perl/ch-1.pl                                                 244          165           23           56
 athanasius/perl/ch-2.pl                                                 206          134           23           49
 mattneleigh/perl/ch-2.pl                                                133           62           48           23
 robert-dicicco/perl/ch-2.pl                                              63           52            1           10
 mattneleigh/perl/ch-1.pl                                                 99           46           35           18
 jo-37/perl/ch-2.pl                                                       76           43            6           27
 dave-jacoby/perl/ch-2.pl                                                 49           41            1            7
 jo-37/perl/ch-1.pl                                                       76           40           14           22
 bob-lied/perl/ch-1.pl                                                    62           36           19            7
 kjetillll/perl/ch-1.pl                                                   42           34            2            6
 robert-dicicco/perl/ch-1.pl                                              44           33            1           10
 robbie-hatley/perl/ch-1.pl                                              115           32           71           12
 robbie-hatley/perl/ch-2.pl                                              117           32           73           12
 kjetillll/perl/ch-2.pl                                                   40           32            2            6
 spadacciniweb/perl/ch-2.pl                                               61           32           25            4
 packy-anderson/perl/ch-1.pl                                              38           30            1            7
 ianrifkin/perl/ch-2.pl                                                   49           29           10           10
 peter-meszaros/perl/ch-2.pl                                              69           28           33            8
 bob-lied/perl/ch-2.pl                                                    59           27           23            9
 spadacciniweb/perl/ch-1.pl                                               62           27           30            5
 jeanluc2020/perl/ch-2.pl                                                 74           23           48            3
 packy-anderson/perl/ch-2.pl                                              29           23            1            5
 dave-jacoby/perl/ch-1.pl                                                 28           22            1            5
 ulrich-rieke/perl/ch-2.pl                                                28           22            4            2
 peter-meszaros/perl/ch-1.pl                                              62           21           33            8
 peter-campbell-smith/perl/ch-2.pl                                        30           21            2            7
 zapwai/perl/ch-2.pl                                                      24           20            4            0
 lubos-kolouch/perl/ch-2.pl                                               30           19            3            8
 e-choroba/perl/ch-2.pl                                                   24           18            1            5
 ulrich-rieke/perl/ch-1.pl                                                19           17            1            1
 zapwai/perl/ch-1.pl                                                      15           15            0            0
 ianrifkin/perl/ch-1.pl                                                   28           15            7            6
 jeanluc2020/perl/ch-1.pl                                                 63           14           47            2
 perlboy1967/perl/ch-2.pl                                                 37           13           18            6
 deadmarshal/perl/ch-2.pl                                                 17           13            1            3
 peter-campbell-smith/perl/ch-1.pl                                        22           13            3            6
 roger-bell-west/perl/ch-2.pl                                             18           12            1            5
 lubos-kolouch/perl/ch-1.pl                                               18           11            1            6
 wlmb/perl/ch-2.pl                                                        16           11            5            0
 matthias-muth/perl/ch-2.pl                                               24           11            9            4
 matthias-muth/perl/ch-1.pl                                               24           11            9            4
 e-choroba/perl/ch-1.pl                                                   14           10            1            3
 perlboy1967/perl/ch-1.pl                                                 33           10           17            6
 roger-bell-west/perl/ch-1.pl                                             15           10            1            4
 wlmb/perl/ch-1.pl                                                        14            9            5            0
 razetime/prolog/ch-2.pl                                                  12            9            0            3
 deadmarshal/perl/ch-1.pl                                                 12            8            1            3
 jaldhar-h-vyas/perl/ch-1.pl                                               8            5            1            2
 razetime/prolog/ch-1.pl                                                   6            5            0            1
----------------------------------------------------------------------------------------------------------------------------------
 Python                                                                    19          647          371          163          113
----------------------------------------------------------------------------------------------------------------------------------
 pokgopun/python/ch-2.py                                                  67           62            2            3
 pokgopun/python/ch-1.py                                                  53           49            2            2
 robert-dicicco/python/ch-1.py                                            46           37            1            8
 packy-anderson/python/ch-1.py                                            34           26            1            7
 ianrifkin/python/ch-2.py                                                 34           20            9            5
 packy-anderson/python/ch-2.py                                            27           20            1            6
 jeanluc2020/python/ch-2.py                                               70           18           48            4
 luca-ferrari/python/ch-2.py                                              39           18            9           12
 steven-wilson/python/ch-2.py                                             23           17            1            5
 lubos-kolouch/python/ch-2.py                                             28           16            6            6
 steven-wilson/python/ch-1.py                                             20           14            1            5
 roger-bell-west/python/ch-2.py                                           20           12            1            7
 roger-bell-west/python/ch-1.py                                           19           11            1            7
 ianrifkin/python/ch-1.py                                                 22           11            6            5
 lubos-kolouch/python/ch-1.py                                             18           10            2            6
 luca-ferrari/python/ch-1.py                                              31           10           11           10
 jeanluc2020/python/ch-1.py                                               61            9           47            5
 eric-cheung/python/ch-2.py                                               21            8            7            6
 eric-cheung/python/ch-1.py                                               14            3            7            4
----------------------------------------------------------------------------------------------------------------------------------
 Lua                                                                        4          123          105            0           18
----------------------------------------------------------------------------------------------------------------------------------
 roger-bell-west/lua/ch-2.lua                                             55           49            0            6
 roger-bell-west/lua/ch-1.lua                                             35           29            0            6
 deadmarshal/lua/ch-2.lua                                                 21           18            0            3
 deadmarshal/lua/ch-1.lua                                                 12            9            0            3
----------------------------------------------------------------------------------------------------------------------------------
 Rust                                                                       4           99           88            1           10
----------------------------------------------------------------------------------------------------------------------------------
 roger-bell-west/rust/ch-2.rs                                             35           31            0            4
 ulrich-rieke/rust/ch-2.rs                                                22           21            0            1
 ulrich-rieke/rust/ch-1.rs                                                21           20            0            1
 roger-bell-west/rust/ch-1.rs                                             21           16            1            4
----------------------------------------------------------------------------------------------------------------------------------
 Edn                                                                        2           84           69            2           13
----------------------------------------------------------------------------------------------------------------------------------
 tyler-wardhaugh/clojure/bb.edn                                           68           55            0           13
 tyler-wardhaugh/clojure/deps.edn                                         16           14            2            0
----------------------------------------------------------------------------------------------------------------------------------
 C++                                                                        2           72           62            6            4
----------------------------------------------------------------------------------------------------------------------------------
 ulrich-rieke/cpp/ch-2.cpp                                                48           39            6            3
 ulrich-rieke/cpp/ch-1.cpp                                                24           23            0            1
----------------------------------------------------------------------------------------------------------------------------------
 Ruby                                                                       5          118           59           31           28
----------------------------------------------------------------------------------------------------------------------------------
 roger-bell-west/ruby/ch-2.rb                                             26           17            1            8
 roger-bell-west/ruby/ch-1.rb                                             23           15            1            7
 deadmarshal/ruby/ch2.rb                                                  16           12            1            3
 robert-dicicco/ruby/ch-1.rb                                              43            9           27            7
 deadmarshal/ruby/ch1.rb                                                  10            6            1            3
----------------------------------------------------------------------------------------------------------------------------------
 YAML                                                                       1           58           58            0            0
----------------------------------------------------------------------------------------------------------------------------------
 roger-bell-west/tests.yaml                                               58           58            0            0
----------------------------------------------------------------------------------------------------------------------------------
 Scala                                                                      2           55           51            0            4
----------------------------------------------------------------------------------------------------------------------------------
 roger-bell-west/scala/ch-2.scala                                         28           26            0            2
 roger-bell-west/scala/ch-1.scala                                         27           25            0            2
----------------------------------------------------------------------------------------------------------------------------------
 JavaScript                                                                 2           53           47            0            6
----------------------------------------------------------------------------------------------------------------------------------
 roger-bell-west/javascript/ch-2.js                                       27           24            0            3
 roger-bell-west/javascript/ch-1.js                                       26           23            0            3
----------------------------------------------------------------------------------------------------------------------------------
 Kotlin                                                                     2           53           47            0            6
----------------------------------------------------------------------------------------------------------------------------------
 roger-bell-west/kotlin/ch-2.kt                                           27           24            0            3
 roger-bell-west/kotlin/ch-1.kt                                           26           23            0            3
----------------------------------------------------------------------------------------------------------------------------------
 Go                                                                         2          145           46           91            8
----------------------------------------------------------------------------------------------------------------------------------
 pokgopun/go/ch-2.go                                                      78           26           48            4
 pokgopun/go/ch-1.go                                                      67           20           43            4
----------------------------------------------------------------------------------------------------------------------------------
 Haskell                                                                    4           57           46            1           10
----------------------------------------------------------------------------------------------------------------------------------
 ulrich-rieke/haskell/ch-2.hs                                             20           16            1            3
 deadmarshal/haskell/ch2.hs                                               14           11            0            3
 ulrich-rieke/haskell/ch-1.hs                                             12           11            0            1
 deadmarshal/haskell/ch1.hs                                               11            8            0            3
----------------------------------------------------------------------------------------------------------------------------------
 SQL                                                                        2           55           35           12            8
----------------------------------------------------------------------------------------------------------------------------------
 luca-ferrari/postgresql/ch-2.sql                                         37           26            6            5
 luca-ferrari/postgresql/ch-1.sql                                         18            9            6            3
----------------------------------------------------------------------------------------------------------------------------------
 Lisp                                                                       2           25           21            0            4
----------------------------------------------------------------------------------------------------------------------------------
 deadmarshal/cl/ch2.lisp                                                  15           13            0            2
 deadmarshal/cl/ch1.lisp                                                  10            8            0            2
----------------------------------------------------------------------------------------------------------------------------------
 PSL Assertion                                                              1           24           21            0            3
----------------------------------------------------------------------------------------------------------------------------------
 robert-dicicco/powershell/ch-1.psl                                       24           21            0            3
----------------------------------------------------------------------------------------------------------------------------------
 TCL                                                                        1           49           21           19            9
----------------------------------------------------------------------------------------------------------------------------------
 robert-dicicco/tcl/ch-1.tcl                                              49           21           19            9
----------------------------------------------------------------------------------------------------------------------------------
 Julia                                                                      1           43           11           27            5
----------------------------------------------------------------------------------------------------------------------------------
 robert-dicicco/julia/ch-1.jl                                             43           11           27            5
----------------------------------------------------------------------------------------------------------------------------------
 Shell                                                                      2            6            2            2            2
----------------------------------------------------------------------------------------------------------------------------------
 jaldhar-h-vyas/raku/ch-1.sh                                               3            1            1            1
 jaldhar-h-vyas/perl/ch-2.sh                                               3            1            1            1


Our solo sponsor Pete Sergeant has been a great support to keep us motivated. We are lucky that he agreed to continue the journey with us in the year 2023. I would like to personally thank Pete and his entire team for their generosity. It would be great if we could add few more to sponsor the prize money so that we could go back and declare weekly champions as we have done in the past. I hope and wish this will become possible in 2023. The amount doesn’t have to be huge. However, it would be nice to show off bunch of supporters. If an organisation comes forward and supports us then that would be the ultimate achievement.


RECAP


Quick recap of The Weekly Challenge - 239 by Mohammad S Anwar.


PERL REVIEW


If you missed any past reviews then please check out the collection.


RAKU REVIEW


If you missed any past reviews then please check out the collection.


CHART


Please take a look at the charts showing interesting data.

I would like to THANK every member of the team for their valuable suggestions. Please do share your experience with us.


NEW MEMBERS


1. Raghu R., an experienced Perl hacker from India joined the Team PWC.

2. lacek96, an experienced Perl hacker joined the Team PWC.

3. Magnus Markling, an experienced Uiua hacker from Sweden joined the Team PWC.


Please find out How to contribute?, if you have any doubts.

Please try the excellent tool EZPWC created by respected member Saif Ahmed of Team PWC.


GUESTS


Please check out the guest contributions for the Week #239.

Please find past solutions by respected guests. Please share your creative solutions in other languages.


Task 1: Acronym

Submitted by: Mohammad S Anwar

You are given an array of strings and a check string.

Write a script to find out if the check string is the acronym of the words in the given array.

Example 1

Input: @str = ("Perl", "Python", "Pascal")
       $chk = "ppp"
Output: true

Example 2

Input: @str = ("Perl", "Raku")
       $chk = "rp"
Output: false

Example 3

Input: @str = ("Oracle", "Awk", "C")
       $chk = "oac"
Output: true

Task 2: Build Array

Submitted by: Mohammad S Anwar

You are given an array of integers.

Write a script to create an array such that new[i] = old[old[i]] where 0 <= i < new.length.

Example 1

Input: @int = (0, 2, 1, 5, 3, 4)
Output: (0, 1, 2, 4, 5, 3)

Example 2

Input: @int = (5, 0, 1, 2, 3, 4)
Output: (4, 5, 0, 1, 2, 3)


Last date to submit the solution 23:59 (UK Time) Sunday 29th October 2023.


SO WHAT DO YOU THINK ?

If you have any suggestions or ideas then please do share with us.

Contact with me