in reply to (MeowChow) Re: 'Holy in one' another Golf Game!
in thread 'Holy in one' another Golf Game!

Maybe you could explain your interpretation of the problem, because it seems ambiguous to me. 18 characters, and it does some stuff:
sub X { (1<<pop)&(pop|pop) }
Here I'm presuming $a and $b are two values, and that a third parameter $c indicates which bit is required, such that if $c were 4, the 4th bit was extracted (24 or 16) and returned as is, with the 4th bit being either 1 or 0 as was in the input.

Pop. Pop. Pop.

Update:
My reply fell of the edge of the world, so I've reproduced it here: 20 characters:
sub X{ ($_=pop)&pop|~$_&pop }

Replies are listed 'Best First'.
(MeowChow) Re3: 'Holy in one' another Golf Game!
by MeowChow (Vicar) on Jul 27, 2001 at 13:10 UTC
    You have the right idea, but extrapolate it for all the bits of $a, $b, and $c. The $c is essentially a multichannel multiplexer for inputs $a and $b. It specifies whether to select the bit from $a or $b for each digit of the output.

    So with:

    my $a = 0b10101010; my $b = 0b11001100; my $c = 0b11110000; #result: 11001010
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      When you said "multichannel multiplexer" it all made sense. How about this one, at 20 characters:
      sub X{ ($_=pop)&pop|~$_&pop }
        Next time I'll remember not to make sense :) Nice shot!
           MeowChow                                   
                       s aamecha.s a..a\u$&owag.print