📘 Computing Fibonacci numbers using Perl 6

Print the Nth Fibonacci number. Fibonacci numbers are defined by the recurring formula: fn = fn-1 + fn-2. In Perl, you can assign two values at a time (see Task 48, Swap two values). You can use that technique for calculating the next Fibonacci number from the previous two. To bootstrap the algorithm, the two first … Continue reading “📘 Computing Fibonacci numbers using Perl 6”

🎄 15/25. Playing with Fibonacci numbers in Perl 6

Welcome to Day 15 of the Perl 6 One-Liner Advent Calendar! Today, there will be two one-liners, and they both generate Fibonacci numbers. Yes, most likely, you never used such numbers in real code, and, again, most likely, you solved many educating problems with them. Nevertheless, today, let’s solve the Problem 25 of the Project … Continue reading “🎄 15/25. Playing with Fibonacci numbers 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”

Raku challenges — Index

Here, you find all links to the blog posts with explanations to my solutions of the Perl Weekly Challenges written in the Raku programming language. The source codes are available on GitHub in the raku-challenges repository. Browse the category ‘Raku challenges’ to see all articles about this. Use the table below to navigate directly to … Continue reading “Raku challenges — Index”

Using Perl 6

There is a new version of this book. If you want to get an electronic copy or a paperback, see Using Raku for more details. 100 Programming Challenges Solved with the Perl 6 Programming Language This book is a collection of different programming challenges and solutions in Perl 6. It can be used as an … Continue reading “Using Perl 6”

🎄 26/25. Overview of the Perl 6 One-Liner Advent Calendar 2018

The Perl 6 One-Liner Advent Calendar 2018 is over! Let’s make a quick overview of what we have covered so far. There were a few themes covered. First, some one-liners from the Perl 6 Calendar 2019 were explained in more detail. We looked at how to generate random passwords and random integers, how to print … Continue reading “🎄 26/25. Overview of the Perl 6 One-Liner Advent Calendar 2018”

🎄 17/25. Playing with prime numbers in Perl 6

Welcome to Day 17 of the Perl 6 One-Liner Advent Calendar! Today, we’ll have two one-liners, both generating some prime numbers. Part 1 First, let us solve Problem 7 of Project Euler, where you need to print the 10001st number (having the first being 2). Perl 6 is good at prime numbers, as it has … Continue reading “🎄 17/25. Playing with prime numbers in Perl 6”

📘 Whatever (*) and WhateverCode in Perl 6

In Perl 6, the star character * can be associated with one of the predefined classes, Whatever and WhateverCode. We’ll start with an object of the Whatever class. say *.WHAT; # (Whatever) The construction like 1 .. * creates a Range object, where its upper limit is not fixed to any particular number. say (1 … Continue reading “📘 Whatever (*) and WhateverCode in Perl 6”

Contents

The posts on this site are grouped into a few series. There is also a free Perl 6 book published as a series of blog posts. Books 📘 Raku One-Liners — The new book about using the expressive power of the Raku language to create short and useful programs. Free PDF. 📘 Using Raku — The second … Continue reading “Contents”