in reply to Re^2: help with simplifying program
in thread help with simplifying program

You should figure this out yourself!! Read the documentation!!

use strict; use warnings; use Algorithm::Combinatorics qw(combinations); my $rep = 5; # should be 100 my @data = 0..$rep; my $iter = combinations( \@data, 4 ); while( my $p = $iter->next ) { my ( $z, $y, $x, $w ) = @$p; next unless $w-2*$x+$y or $x-2*$y+$z; print "$w, $x, $y, $z\n"; }

Replies are listed 'Best First'.
Re^4: help with simplifying program
by crunch_this! (Acolyte) on May 24, 2013 at 21:22 UTC
    I've got a bunch of different cases I want to look at so this is only a template. I pasted the stuff with map/grep instead of printing the 4 variables. I can figure out how to modify things it's just the first step that I usually get stuck on. Thx very much for helping anyway.