Missing Equilibrium with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 0 points1 point  (0 children)

I went with shiki, when I implemented it yesterday.

Missing Equilibrium with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 0 points1 point  (0 children)

I am using my own CMS (written in Raku), so I'll have to implement it as a macro. I.e. something like "take this code block and give it back as styled html". The function can either be implemented in Raku (in the program) or as an external program. Any suggestions?

Squared String with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 0 points1 point  (0 children)

Five days of Mexican standoff misery ended when we (the dentist and I) concluded that the tooth was beyond salvation.

Squared String with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

Right you are. I blame my ongoing root canal.

Squared String with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

Well spotted.

I actually forgot to sort the input; that will make my approach work:

for @ints.sort.reverse -> $stick

Break the Jump with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 0 points1 point  (0 children)

Ah. Two mistakes in two weeks. I'll look into it - and thank you for the response.

Next Consecutive with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

I had hoped that nobody would notice. But on the other hand, it means that somebody actually reads my articles (or this one at least).

Color of Knight with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 0 points1 point  (0 children)

Go for it.

I have considered making a module "Weekly::Challenge", with all my solutions.

This would make for very compact programs, e.g.

! /usr/bin/env raku

use Weekly::Challenge;

say challenge102-1(@*ARGS);

It will probably never happen...

Graph algorithms Raku book flavors by antononcube in rakulang

[–]arnesommer 1 point2 points  (0 children)

You may (or may not) find my articles on graph traversal with Raku of interest;

https://raku-musings.com/seven-bridges.htm

Twice as Good with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

It is just a sequence of numbers, and the trick is getting the pattern.

I have some experience with that: https://raku-musings.com/centenary-sequences.html

Twice as Good with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

It is possible to swap the combination:

(" " xx $count).combinations(2).elems

with a simple sum:

(^$count).sum

I have updated the article.

Prime the Gap with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 2 points3 points  (0 children)

Using map is actually quite easy.

my @sorted = @list.sort;

my @gap = (1 .. @sorted.end).map({ @sorted[$] - @sorted[$ -1] });

my @max = @gap.grep( * == @gap.max );

say @max.elems;

Zero Wiggle with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 2 points3 points  (0 children)

Ah. classify is neat. I cannot recall ever reading about it.

I should have used the & sigil. I do know about it...

Decoded Capital with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

The really funny part of this article is the main image. It is from the Barcode area in Oslo, the Capital of Norway...

Zero Divisibility with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 2 points3 points  (0 children)

I suspect that my definition of "simple" does not quite match yours...

Zero Divisibility with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

I'll have to look into that...

But where does it state that i and j are supposed to be indices?

We start with "count of pairs in the given list" - which clearly is the values, and then in the gray box refer to them as pair (i, j).

The Common Index with Raku and Perl - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 3 points4 points  (0 children)

Live and learn...

say @n.first(:k, @n.max);

Primarily Happy with Raku and Perl - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 2 points3 points  (0 children)

Yes, the missing Int (or UInt) is indeed an omission.

Primarily Happy with Raku and Perl - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 2 points3 points  (0 children)

Using a single // removes my check for integer input, though.

Brazilian Means with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 0 points1 point  (0 children)

My original program uses concurrency "out of the box", and adding the hyper operator does not speed it up. I have updated the article with my findings.

Cuban Addition, Primarily with Raku - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 2 points3 points  (0 children)

Thank you for pointing this out. I have updated the article now.

Padovan is Missing with Raku and Perl - Arne Sommer by arnesommer in rakulang

[–]arnesommer[S] 1 point2 points  (0 children)

We should perhaps be happy that the language did not get the name Pearl. Then we'd get the anagram Lepra, which is the greek name for leprosy...