in reply to (GOLF) splitting an hexadecimal colour triplet
Much too much code. (Here's one that's 27 chars.)
sub hexa_triplet { map{($_[0]>>$_)&255}16,8,0 }
update:
Or even another way at 24 chars (like my other one
was reduced to by MeowChow) 23 chars:
sub hexa_triplet { unpack"xC3",pack"N",@_ }
-- perl -e '$|--;$.=q$.$;while($i!=0){$i=(time-$^T)%60;print"\r".$.x$i}'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: (GOLF) splitting an hexadecimal colour triplet
by MeowChow (Vicar) on Jul 05, 2001 at 21:32 UTC | |
Re: Re: (GOLF) splitting an hexadecimal colour triplet
by tachyon (Chancellor) on Jul 05, 2001 at 21:24 UTC | |
by btrott (Parson) on Jul 05, 2001 at 21:37 UTC |
In Section
Obfuscated Code