Quiz: Unicode digits and numbers
Try to find out which of the following digits form integers that Raku accepts as the
Int type values.
|1||⓷||This is considered a number, not a single digit.|
|0||⓵⓶⓷⓸⓹||So you cannot combine them in such a way to get
|1||㊷||A single Unicode character named
|0||⓸⓶||But the two numbers are not a number.|
|1||㊄||Circled Chinese 5 and it is a number
|0||五||While this means 5, the character is neither a digit nor a number.|
You can take the following program as a starting point to play with and explore the properties of such digits. Uncomment the lines to see if that compiles.
my $x; $x = 3; say $x; say $x.WHAT; $x = 12345; $x = ⓷; # $x = ⓵⓶⓷⓸⓹; $x = ❷; # $x = ❸❹❺; $x = ⒌; # $x = ⒊⒋⒌; # $x = ㊀㊁㊂㊃㊄; $x = ㊄; say $x; say $x.WHAT; # $x = 五; # $x = 一二三四五; $x = ㊷; say $x;
🦋 Take the code from GitHub: unicode-digits.raku.
💪 Or jump directly to the exercises to this section.