Thanks for sharing.

I think Moritz's answer is great. I may change 'a'.ord - 1 to 96 because I
know the ascii code for a, which was a question in my exam.

However, why 42? any relation to meaning of life? It seems I miss
something. Thanks.

Best,

Hao

On Sun, May 26, 2013 at 5:49 AM, Marc Chantreux <kha...@phear.org> wrote:

> hello guys,
>
> seen on facebook today:
>
>
> https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-frc1/575835_600378583316490_2003314912_n.jpg
>
> which is a good excuse for a little perl6 exercice: proove it!
>
> my result:
>
> say [+]
>     ('a'..'z')\
>     .pairs\
>     .map: { 1 + .key if .value ~~ any < m a t h > }
>
> i already know i have to get used to the anoying \ at the end of the
> lines but i'm pretty sure there are plenty ways to make this expression
> shorter.
>
> things i tried to get shorter:
> * .value ~~ any < m a t h >
> * ('a'..'z')
>
> thanks for any golf demo :)
>
> regards
> --
> Marc Chantreux (eiro on github and freenode)
> http://eiro.github.com/
> http://eiro.github.com/atom.xml
> "Don't believe everything you read on the Internet"
>     -- Abraham Lincoln
>

Reply via email to