Fibonacci word: Difference between revisions
m
Fix Perl 6 -> Raku in comments
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
Thundergnat (talk | contribs) m (Fix Perl 6 -> Raku in comments) |
||
Line 3,199:
}</lang>
That works, but is terribly slow due to all the string processing and bag creation, just to count 0's and 1's. By contrast, the following prints the table up to 100 almost instantly by tracking the values to calculate entropy in parallel with the actual strings. This works in
<lang perl6>constant @fib-word = '1', '0', { $^b ~ $^a } ... *;
|