diff options
| author | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2024-09-09 23:00:19 +0100 |
|---|---|---|
| committer | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2024-09-09 23:00:19 +0100 |
| commit | 01a61e8f645494a0aa4729f3178dd4791b26bdd4 (patch) | |
| tree | 80da43c68ae1931556f030f2ed48d4f9e6388c67 /challenge-286 | |
| parent | 3cc40ed1b178e5d7111f30aa53772d0a2c07a14b (diff) | |
| download | perlweeklychallenge-club-01a61e8f645494a0aa4729f3178dd4791b26bdd4.tar.gz perlweeklychallenge-club-01a61e8f645494a0aa4729f3178dd4791b26bdd4.tar.bz2 perlweeklychallenge-club-01a61e8f645494a0aa4729f3178dd4791b26bdd4.zip | |
- Added solutions by Laurent Rosenfeld.
- Added solutions by Thomas Kohler.
- Added solutions by Peter Meszaros.
- Added solutions by Conor Hoekstra.
- Added solutions by Torgny Lyon.
- Added solutions by Paulo Custodio.
Diffstat (limited to 'challenge-286')
| -rw-r--r-- | challenge-286/conor-hoekstra/bqn/ch-1.bqn (renamed from challenge-286/conor-hoekstra/ch-1.bqn) | 0 | ||||
| -rw-r--r-- | challenge-286/conor-hoekstra/bqn/ch-2.bqn (renamed from challenge-286/conor-hoekstra/ch-2.bqn) | 0 | ||||
| -rw-r--r-- | challenge-286/laurent-rosenfeld/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-286/laurent-rosenfeld/perl/ch-1.pl | 12 | ||||
| -rw-r--r-- | challenge-286/laurent-rosenfeld/raku/ch-1.raku | 1 |
5 files changed, 14 insertions, 0 deletions
diff --git a/challenge-286/conor-hoekstra/ch-1.bqn b/challenge-286/conor-hoekstra/bqn/ch-1.bqn index e4b86c7de8..e4b86c7de8 100644 --- a/challenge-286/conor-hoekstra/ch-1.bqn +++ b/challenge-286/conor-hoekstra/bqn/ch-1.bqn diff --git a/challenge-286/conor-hoekstra/ch-2.bqn b/challenge-286/conor-hoekstra/bqn/ch-2.bqn index d572e07af0..d572e07af0 100644 --- a/challenge-286/conor-hoekstra/ch-2.bqn +++ b/challenge-286/conor-hoekstra/bqn/ch-2.bqn diff --git a/challenge-286/laurent-rosenfeld/blog.txt b/challenge-286/laurent-rosenfeld/blog.txt new file mode 100644 index 0000000000..cf13d7e21b --- /dev/null +++ b/challenge-286/laurent-rosenfeld/blog.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2024/09/perl-weekly-challenge-286-self-spammer.html diff --git a/challenge-286/laurent-rosenfeld/perl/ch-1.pl b/challenge-286/laurent-rosenfeld/perl/ch-1.pl new file mode 100644 index 0000000000..7cf1875a50 --- /dev/null +++ b/challenge-286/laurent-rosenfeld/perl/ch-1.pl @@ -0,0 +1,12 @@ +use strict; +use warnings; +use feature 'say'; + +my @words; +open my $FH, '<', __FILE__ or die "Error opening file"; +while (<$FH>) { + s/^\s+//g; # remove leading spaces from $_ if any + push @words, split /\s+/, $_; +} +close $FH; +say $words[int(rand($#words + 1))]; diff --git a/challenge-286/laurent-rosenfeld/raku/ch-1.raku b/challenge-286/laurent-rosenfeld/raku/ch-1.raku new file mode 100644 index 0000000000..bc04112f45 --- /dev/null +++ b/challenge-286/laurent-rosenfeld/raku/ch-1.raku @@ -0,0 +1 @@ +say $?FILE.IO.words.pick; |
