<commit_before>---
layout: post
title:  "Perl Weekly Challenge 117: simpler than it seems"
author: <NAME>
tags:
- raku
- perlweeklychallenge
permalink: /:year/:month/:day/:title.html
---
My personal solutions to the Perl Weekly Challenge.

# Perl Weekly Challenge 119: numbers

One way to let me improve my knowledge about Raku (aka Perl 6) is to implement programs in it.
Unluckily, I don't have any production code to implement in Raku yet (sob!).
So, why not try solving the [Perl Weekly Challenge](https://perlweeklychallenge.org/){:target="_blank"} tasks?
<br/>
<br/>
In the following, the assigned tasks for [Challenge 110](https://perlweeklychallenge.org/blog/perl-weekly-challenge-0110/){:target="_blank"}.
<br/>
- [Task 1](#task1)
- [Task 2](#task2)



<a name="task1"></a>
## PWC 119 - Task 1

The first task was about *rotating nibbles*, that means convert an integer to a bit string, and switch the half-octect, printing out the resulting number. One constraint that makes it really simple is that the incoming number must be less than `256`, that means we have a single octet and thus two nibbles.

<br/>
<br/>
```raku<commit_msg>Fix PWC number<commit_after>---
layout: post
title:  "Perl Weekly Challenge 119: simpler than it seems"
author: <NAME>
tags:
- raku
- perlweeklychallenge
permalink: /:year/:month/:day/:title.html
---
My personal solutions to the Perl Weekly Challenge.

# Perl Weekly Challenge 119: numbers

One way to let me improve my knowledge about Raku (aka Perl 6) is to implement programs in it.
Unluckily, I don't have any production code to implement in Raku yet (sob!).
So, why not try solving the [Perl Weekly Challenge](https://perlweeklychallenge.org/){:target="_blank"} tasks?
<br/>
<br/>
In the following, the assigned tasks for [Challenge 110](https://perlweeklychallenge.org/blog/perl-weekly-challenge-0110/){:target="_blank"}.
<br/>
- [Task 1](#task1)
- [Task 2](#task2)



<a name="task1"></a>
## PWC 119 - Task 1

The first task was about *rotating nibbles*, that means convert an integer to a bit string, and switch the half-octect, printing out the resulting number. One constraint that makes it really simple is that the incoming number must be less than `256`, that means we have a single octet and thus two nibbles.

<br/>
<br/>
```raku
{'fraction_non_alphanumeric': 0.11630957586357674, 'fraction_numerical': 0.022737210319195452, 'mean_word_length': 4.434679334916865, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6122704', 'n_tokens_mistral': 778, 'n_tokens_neox': 685, 'n_words': 305}