Git Product home page Git Product logo

manwar / perlweeklychallenge-club Goto Github PK

View Code? Open in Web Editor NEW
173.0 9.0 311.0 123.02 MB

Knowledge base for The Weekly Challenge club members using Perl, Raku, Ada, APL, Awk, Bash, BASIC, Bc, Befunge-93, Bourne Shell, BQN, Brainfuck, C3, C, CESIL, C++, C#, Clojure, COBOL, Coconut, Crystal, D, Dart, Dc, Elm, Emacs Lisp, Erlang, Excel VBA, Fennel, Fish, Forth, Fortran, Gembase, GNAT, Go, Haskell, Haxe, HTML, Idris, IO, J, Janet, Java, JavaScript, Julia, Kotlin, Lisp, Lua, M4, Miranda, Modula 3, MMIX, Mumps, Myrddin, Nim, Nix, Node.js, Nuweb, OCaml, Odin, Ook, Pascal, PHP, Python, Postscript, Prolog, R, Ring, Ruby, Rust, Scala, Scheme, Sed, Smalltalk, SQL, Swift, Tcl, TypeScript, Visual BASIC, WebAssembly, Wolfram, XSLT and Zig.

Home Page: https://theweeklychallenge.org

Java 0.77% PLpgSQL 0.27% Python 4.52% Raku 17.65% Go 0.96% Crystal 0.02% JavaScript 1.31% Kotlin 0.58% Lua 1.15% Perl 49.38% PostScript 1.50% Ruby 0.96% Shell 1.02% Scala 0.21% C 4.07% Makefile 0.12% Prolog 14.86% Racket 0.01% Julia 0.36% Awk 0.28%

perlweeklychallenge-club's Issues

Challenge solutions not compliant

One of the PWC members submitted a solution in Bash to challenge 104 like this:
echo "0 1 1 2 1 3 2 3 1 4 3 5 2 5 3 4 1 5 4 7 3 8 5 7 2 7 "
"5 8 3 7 4 5 1 6 5 9 4 11 7 10 3 11 8 13 5 12 7 9 2 9"

This is not generating the sequence of the 50 first FUCS numbers as requested.

Should this be accepted as a valid solution? What if someone writes a program in Perl to output code in N languages to just print the result of the Perl computation?

Befunge -> Befunge-93

It would be better to classify my Befunge-93 solutions as Befunge-93, not just Befunge. The differences between Befunge-93 and (Be)funge-98 are substantial, aka C vs C++ and Perl5 vs Perl6^WRaku.

git operations take a lot of time

Currently there are over 70,000+ files in this repository and every week we're adding 100s of files (every week a directory is created for every user and the previous "README" is copied).

I started participating with challenge-076. According to my records I've submitted solutions for 25 challenges, so there are ~100 useless directories with my name and a README file. With around 300 users, I believe this adds up.

My primary machine is not very fast and it takes 70 seconds to run git status.

andinus@ ~//perlweeklychallenge-club > time git status                
On branch master                                                                              
Your branch is up to date with 'origin/master'.                                               
                                                                                              
                                                                                              
It took 54.97 seconds to enumerate untracked files. 'status -uno'                             
may speed it up, but you have to be careful not to forget to add                              
new files yourself (see 'git help status').                                                   
nothing to commit, working tree clean                                                         
                                                                                              
________________________________________________________                                      
Executed in   71.65 secs                                       
                                                                                              
andinus@ ~//perlweeklychallenge-club > time git status -uno                 
On branch master                                                                              
Your branch is up to date with 'origin/master'.                                               
                                                                                              
nothing to commit (use -u to show untracked files)
                                                                                              
________________________________________________________                                      
Executed in   16.89 secs

benchmark scaleability of solutions

I am interested in learning from solutions to Raku/Perl weekly challenge that are readable and efficient - the second point I can not judge easily by just running the provided minimal testcases.

I was wondering if there is interest out there in automatically comparing different solutions in terms of scalability - meaning, what problem size can be solved in a fixed runtime.

First thoughts and a first shot #8644 and a github-action how an automated process might look like (look into "Run Benchmark" and scroll down a bit).

It looks like this:

O-----------------O---------O--------O-------------O-------------O
| user            | runtime | n      | latency     | total       |
O=================O=========O========O=============O=============O
| two-colours     | 3       | 524288 | 0.94618477  | 1.78539195  |
| mark-anderson   | 3       | 524288 | 0.934987441 | 1.797814585 |
| arne-sommer     | 3       | 524288 | 0.951995122 | 2.034696379 |
| bruce-gray      | 3       | 524288 | 0.966044871 | 2.068688515 |
| Orir            | 3       | 524288 | 1.171071109 | 2.081696549 |
| roger-bell-west | 3       | 524288 | 2.077494412 | 2.574138279 |
| rcmlz           | 3       | 262144 | 0.47831577  | 1.52560537  |
| wambash         | 3       | 262144 | 0.481722904 | 1.922695617 |
| jaldhar-h-vyas  | 3       | 262144 | 2.462856115 | 2.865514525 |
| deadmarshal     | 3       | 65536  | 2.532371318 | 2.635808188 |
| ash             | 3       | 65536  | 2.621710334 | 2.691216938 |
| barroff         | 3       | 32768  | 1.853222122 | 1.883633262 |
| massa           | 3       | 32768  | 2.576829156 | 2.624975424 |
| ulrich-rieke    | 3       | 4096   | 1.51628605  | 1.519228254 |
------------------------------------------------------------------

After checkout try this:

zef install JSON::Tiny Text::Table::Simple
NR=233
raku --optimize=3 -I challenge-nr$NR -- test/benchmark-scalability.raku --max-run-times=3 --test-before-benchmark=True -v --max-problem=20 --out-folder=/tmp nr$NR

I put in the github-action also a small Tokei analysis, looking like below. Maybe this is usefull for some of us to find interesting solutions of other people.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Language                                                               Files        Lines         Code     Comments       Blanks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Raku                                                                      37          737          540           80          117
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 challenge-nr233/packy-anderson/raku/task-one.rakumod                                   57           36           12            9
 challenge-nr233/ulrich-rieke/raku/task-one.rakumod                                     40           34            2            4
 challenge-nr233/athanasius/raku/task-one.rakumod                                       43           29            2           12
 challenge-nr233/ulrich-rieke/raku/task-two.rakumod                                     29           23            2            4
 challenge-nr233/packy-anderson/raku/task-two.rakumod                                   34           23            6            5
 challenge-nr233/roger-bell-west/raku/task-one.rakumod                                  26           23            1            2
 challenge-nr233/roger-bell-west/raku/task-two.rakumod                                  25           22            1            2
 challenge-nr233/arne-sommer/raku/task-one.rakumod                                      29           22            2            5
 challenge-nr233/rcmlz/raku/task-one.rakumod                                            26           20            2            4
 challenge-nr233/rcmlz/raku/task-two.rakumod                                            27           20            2            5
 challenge-nr233/robert-dicicco/raku/task-one.rakumod                                   23           18            2            3
 challenge-nr233/laurent-rosenfeld/raku/task-two.rakumod                                21           16            2            3
 challenge-nr233/wambash/raku/task-one.rakumod                                          20           15            2            3
 challenge-nr233/luca-ferrari/raku/task-two.rakumod                                     17           13            1            3
 challenge-nr233/barroff/raku/task-two.rakumod                                          17           13            2            2
 challenge-nr233/ash/raku/task-one.rakumod                                              17           13            1            3
 challenge-nr233/ash/raku/task-two.rakumod                                              17           13            1            3
 challenge-nr233/Orir/raku/task-two.rakumod                                             16           12            2            2
 challenge-nr233/Orir/raku/task-one.rakumod                                             17           12            3            2
 challenge-nr233/luca-ferrari/raku/task-one.rakumod                                     16           12            1            3
 challenge-nr233/athanasius/raku/task-two.rakumod                                       16           12            1            3
 challenge-nr233/laurent-rosenfeld/raku/task-one.rakumod                                16           12            2            2
 challenge-nr233/barroff/raku/task-one.rakumod                                          18           12            2            4
 challenge-nr233/jaldhar-h-vyas/raku/task-two.rakumod                                   16           11            2            3
 challenge-nr233/deadmarshal/raku/task-one.rakumod                                      14           10            2            2
 challenge-nr233/wambash/raku/task-two.rakumod                                          14           10            2            2
 challenge-nr233/bruce-gray/raku/task-one.rakumod                                       15           10            3            2
 challenge-nr233/deadmarshal/raku/task-two.rakumod                                      13            9            2            2
 challenge-nr233/arne-sommer/raku/task-two.rakumod                                      12            8            2            2
 challenge-nr233/massa/raku/task-two.rakumod                                            11            8            1            2
 challenge-nr233/jaldhar-h-vyas/raku/task-one.rakumod                                   11            7            2            2
 challenge-nr233/mark-anderson/raku/task-two.rakumod                                    10            7            1            2
 challenge-nr233/mark-anderson/raku/task-one.rakumod                                    10            7            1            2
 challenge-nr233/two-colours/raku/task-one.rakumod                                      12            7            3            2
 challenge-nr233/two-colours/raku/task-two.rakumod                                      11            7            2            2
 challenge-nr233/massa/raku/task-one.rakumod                                            10            7            1            2
 challenge-nr233/bruce-gray/raku/task-two.rakumod                                       11            7            2            2

how to submit perl one liner?

Hello,
if I have a perl oneliner as solution, how to submiti it? I would not to submit it as bash..

Better as a .pl file with the oneliner as first commented line?

Actually I have 2:
206 t1
208 t2

thanks

L*

This program finds a sequence of only 14 words with Mohammad's input list

This program apparently finds a best sequence of only 14 words with Mohammad's input list, and this is (IMHO) wrong. As far as I can say, the longest sequence has at least 23 words, and there are more than two thousand such sequences.

Note: If this Github issue goes to Mohammad, then, @mohammad: please transmit to Simon, I don't have an email address to communicate directly with Simon. @mohammad: please feel free to give my e-mail address to Simon to enable direct mail exchange.

Best regards to both of you,
Laurent.

Suggestion - Data Structure and algorithm in Perl/Raku

While going through github I found some github repository which talk about data structure and algorithm in different languages (mostly python).
A quick google search on data structre and algo for github given me lot of link with implementation in different languages (again mostly python)

Few of them are (top rated)-
https://github.com/TheAlgorithms
https://github.com/keon/algorithms

In 'TheAlgorithm' repo i found they have implementation in almost every language except Perl.
So, I just thought of why we don't have any such repo (Pardon my ignorance if we have).
I know some of us will this this is trivial, but for a new commer(who just freshly graduated) such things are boon. If we want to attract new people in community we should have data structure and algorithm in Perl/Raku.

So, just a suggestion , is it possible to have this thing as weekly challenge ? (say implementation 'sorting/tree' etc. in Perl/Raku) and have a separated repo for all DS implementation in Perl/Raku ?
I think both Perl and Raku will benefit from this (especially Raku).

Uphill Task

Greetings to all teammates.

Do you want to have an extra-challenging task each month?
Or, do you accept coding extra lines in order to solve an interesting task once a month?

Do you know an algorithm from your computer science study, would like to share with TWC teammates, but thought it might be relatively heavy?
Or, do you like to share a practical technique or procedure applied in some widely-used Perl frameworks? Why don't propose the idea as a TWC task?

Or, has an intriguing question just popped in your mind? You simply want to share it.

It is Week 135 of the TWC Calendar and 287 tasks have been appeared. Different algorithms commonly-learnt by computer science students or programmers have been used in the vast amount of solutions. Sometimes some advanced algorithms or data structures were being used. Regular participating teammates may have an expectation of the demand(difficulty, lines needed, number of test cases) of the tasks and arrange a time-slot in their planner to solve the tasks. And some techniques have been used again for the third time and you might want to code more stuff in that week.

Secretly(?), I am a distance runner. Uphill training is a demanding but beneficial workout in distance running. Since it is so demanding, most leisure runners do not put this workout in their usual schedule, or take the workout less frequent than other types of workout. However nobody declines the benefits of uphill training brings. And usually you will have a great sense of satisfaction when it's done!

So, why don't accept AN EXTRA WORKLOAD coding challenge task regularly?


I suggest having an "Uphill Task 2" in the 2nd week of each month.

It can be fun:

  • create an engine to solve a traditional board game;
  • code about something that professional mathematicians in number theory haven't solved. (I just come up with one such kind of coding puzzles, but not to share here in order to keep with the discussion.)

It can be practical:

  • interact with a database;
  • apply support for a famous framework in Perl;
  • design a mini-app according to the requirements;
  • something like API tasks on Week 008 to Week 024 but more sophisticated.

It can be pedagogical:

  • craft a simplified interpreter;
  • simulate a Turing machine;
  • introduce an advanced data structure or algorithm.

What do you think about "having an 'uphill task' in The Weekly Challenge once a month"?
Would you think that it is better to make the "uphill task" as a "Task 3"?? (But a bit increase in administrative workload.)
Do you have any related suggestions? :)

P.S. For an example of what an "uphill task" might look like, N Queens of Week 062 (Week 062 , RECAP) should be a candidate. Or you get other candidates. (I still like the Adventure of Knight, which I proposed, hahaha.)

-- from CY

M4 vs Macro Processor

I've submitted seven M4 solutions in total, but only three of them are classified as M4 solutions -- the other four are classified as "Macro Processor".

While M4 is a macro processor, not all macro processors are M4. And being consistent would be better anyway.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.