Welcome to Day 11 of the Perl 6 One-Liner Advent Calendar! Today, the calendar post is totally devoted to the solution of problem 34 of Project Euler. Once again, let me warn you to pause reading if you want to find your own solution prior to seeing mine. So, the task is to find the … Continue reading “ 11/25. Solving the Problem 34 in Perl 6”
Category: Raku One-Liners
10/25. Reduction operator in Perl 6
Welcome to Day 10 of the Perl 6 One-Liner Advent Calendar! Today, there will be three one-liners instead of a regular one. Our today’s guest is a reduction construction with a pair of square brackets. When they do not surround an array index, they work in a completely different field. Example 1 The most classical … Continue reading “ 10/25. Reduction operator in Perl 6”
9/25. More on X, .., and … in Perl 6
Welcome to Day 9 of the Perl 6 One-Liner Advent Calendar! On Day 6, we had a construct with a cross-operator, (999…100) X* (999…100). Today, we’ll dive into a similar construction from November: 1..10 X* 1..10 It prints the items of the product table for the numbers from 1 to 10: (1 2 3 4 … Continue reading “ 9/25. More on X, .., and … in Perl 6”
8/25. Adding up even Fibonacci numbers in Perl 6
Welcome to Day 8 of this year’s Perl 6 One-Liner Advent Calendar. It is about ¼ of the whole series, and don’t forget that you can type ¼ instead of 0.25 in Perl 6! Today, we are solving problem 2 from Project Euler. The task is to find the sum of all even Fibonacci numbers below four … Continue reading “ 8/25. Adding up even Fibonacci numbers in Perl 6”
7/25. The joy of Unicode in Perl 6
Welcome to Day 7 of the Perl 6 One-Liner Advent Calendar! Today, we’ll look at the month of March in the Perl 6 Calendar 2019: The code here is using three characters outside of the ASCII land. We can even add one more: say π × $𝜌² In Perl 6, you can freely use Unicode … Continue reading “ 7/25. The joy of Unicode in Perl 6”