- or download this
@arr = qw ( up down in out left right );
- or download this
@sel = ( 1, 3, 4 );
- or download this
@my_items = Magic(@arr, @sel);
- or download this
$bitmask = MoreMagic(@arr, @sel);
[...other work...]
@my_items = BetterMagic(@arr, $bitmask);
- or download this
@arr = qw ( up down in out left right ); # 6 elements
@sel = ( 1, 3, 4 );
...
printf("\$item: $item \$mask: %0b\n", $mask);
}
printf(" final \$mask: %0b\n", $mask);