in reply to (Golf) Reversing RPN Notation
118 characters in the body of the sub:
%o = ('+' => 1, '-' => 1, '*' => 2, '/' => 2, ); sub rpn2ltr { for$i(@r=@_){if($p=$o{$i}){$_=$p>$_->[0]?"($_->[1])":$_->[1] for$r=pop,$l=pop}push@_,[$p||9,$p?"$l $i $r":$i]}$_[-1][1] }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: (Golf) Reversing RPN Notation
by MeowChow (Vicar) on May 21, 2001 at 20:33 UTC | |
by chipmunk (Parson) on May 21, 2001 at 20:56 UTC | |
by MeowChow (Vicar) on May 21, 2001 at 21:10 UTC | |
by Masem (Monsignor) on May 21, 2001 at 22:04 UTC | |
by MeowChow (Vicar) on May 21, 2001 at 22:27 UTC | |
by Masem (Monsignor) on May 21, 2001 at 22:39 UTC | |
by MeowChow (Vicar) on May 22, 2001 at 00:02 UTC | |
by bobione (Pilgrim) on May 21, 2001 at 20:46 UTC | |
by MeowChow (Vicar) on May 21, 2001 at 20:55 UTC |