in reply to (Golf) Grey code

Here is my go at 72:
sub grey{ my($b)=@_;my$l=$b<2?['']:grey($b-1); [map("0$_",@$l),map"1$_",reverse@$l] }
Aziz,,,

Replies are listed 'Best First'.
Re: Re: (Golf) Grey code
by Everlasting God (Beadle) on Jul 28, 2001 at 06:55 UTC
    something about the fact that your recursion is considderably faster than my loops scares me...
    update: ahh... now i get it, O(n) vs O(n*log n)

    'The fickle fascination of and Everlasting God' - Billy Corgan, The Smashing Pumpkins