|
Posted by joemacbusiness on March 31, 2008, 6:21 pm
Please log in for more thread options > joemacbusin...@yahoo.com wrote:
> >This has probably already been written but I did not see it on CPAN.
> >Is there a code snippent that can print every possible combination
> >of Y/N's in a 5 position array or string?
>
> I am sure it has been written many times. Search for permutation with
> repetitions.
>
> However, just for the fun of it, here's yet another implementation:
>
> for (0..2**5-1) {
> =A0 =A0 $_ =3D sprintf "%05b", $_;
> =A0 =A0 s/0/N/g;
> =A0 =A0 s/1/Y/g;
> =A0 =A0 print "$_\n";
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -
Hi All,
Got it!
Seriously - this was not an HW assignment. I want exception
reports for a report similar to the following:
Project Loc1 Loc2 Loc3 Loc4 Loc5
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
prod_1 Y Y Y Y Y
prod_2 Y Y N N N
prod_3 Y Y N N N
prod_4 Y Y Y Y Y
prod_5 Y Y Y Y Y
prod_6 Y Y Y Y Y
=2E..
stuff deleted.
So .... show all YYYYN's YNYNY's etc....
Very helpful, thanks again!
--JoeMac
|