Brad Gilbert b2gills
Reputation
203
Top tag
Next privilege 250 Rep.
View close votes
Badges
1 5
Newest
 Yearling
Impact
~118 people reached

Apr
1
answered Count the number of ones in unsigned 16 bit integer
Mar
7
comment Convert a repeated decimal to a fraction
Technically this is written in Rakudo Perl 6 as the Std parser dies with Unsupported use of $/ variable as input record separator; in Perl 6 please use the filehandle's :irs attribute
Jan
29
awarded  Yearling
Jan
27
answered Shortest code special string sort
Jan
27
revised Generate the Stöhr sequence
Make it a Callable object
Jan
27
comment Generate the Stöhr sequence
@MartinBüttner to be fair 1,2,4,*+3...* actually creates an object that will generate the values needed. I don't think that many people would actually create something Callable around something like that in Perl6.
Jan
26
comment String to Binary
@squeamishossifrage the simplest Perl6 code would be $ perl6 -e 'say "Hello World".ords».base(2)'. ( you could use >> instead of » )
Jan
26
revised Generate the Stöhr sequence
Supposed to generate first n elements
Jan
26
answered Generate the Stöhr sequence
Jan
13
awarded  Commentator
Jan
13
comment Produce the number 2014 without any numbers in your source code
say ord "ߞ" is shorter but certainly less whimsical.
Dec
29
answered Find pairs of numbers with a particular LCM and GCD
Dec
29
answered Most common number
Dec
29
comment Write a program that makes 2 + 2 = 5
Interesting this also changes what 1+1+2 and 3-1+2 returns.
Dec
29
comment Print all odd numbers from 0 to 100000
The non-golfed Perl6 answer would be: say "{ 1, 3, 5, 7 ...^ *>100000 }" The golfed version would be: say "{1,3...9 x 5}" or say "{1,3...99999}"
Dec
1
comment Shortest code to print ':)' random times
What's interesting is that this is almost the same as the shortest Perl6 code. The only difference is that Perl6 requires some whitespace after sub calls ( unless you alter the parsing behaviour with a slang or macro ).
Nov
28
comment Is a number divisible by each of its digits?
Actually the first time you use a string as a number or a number as a string, the variable gets modified to hold that additional data. That is why you only get a warning the first time you use 'abc' as a number (assuming you have use warnings; enabled. )
Nov
28
comment Is a number divisible by each of its digits?
Actually the True and False values are more like dualvar(1,'1') and dualvar(0,'').
Nov
28
comment Is a number divisible by each of its digits?
If you want to make it return a Bool just add so to the front of the code so$_%%.comb.all.
Nov
27
comment Shortest code to print ':)' random times
I kind of like say ':)' x (^256).pick better, but there is no way to make it shorter than using rand. Although it does come in handy if you want to output all of the possible outputs in random order .say for ":)" Xx (^256).pick(*)