in reply to Re: Re: Golf: string complement
in thread Golf: string complement
You gotta hate those edge cases! Having just had a look at your example you are passing an array not a string so it looks like a different problem.
38 strokes with fix in 35 strokes.
sub invert{ #2345678901234567890123456789012345678 $_=pack'C*',1..255;s/[\Q$_[0]\E]//g,$_ } print invert('/just Another Bug to Fix!/'); # 35 strokes using @_ hack sub invert{ #2345678901234567890123456789012345 $_=pack'C*',1..255;s/[\Q@_\E]//g,$_ } print invert('/just Another Bug to Fix!/');
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Golf: string complement
by japhy (Canon) on May 15, 2004 at 05:07 UTC | |
|
Re: Re: Re: Re: Golf: string complement
by davido (Cardinal) on May 15, 2004 at 16:16 UTC |