Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Math with Perl, equation combinations:

by ariels (Curate)
on May 11, 2002 at 08:25 UTC ( [id://165855]=note: print w/replies, xml ) Need Help??


in reply to Math with Perl, equation combinations:

The straightforward, structured way of doing this in Perl would have to be
perl -le'for$-(1..15){$==17-$--$_,print"$_+$-+$==17"for($-..16-$-)}'
This works because _+-==.

The `<samp>15</samp>' is just there to confuse your professor; it would work equally well with `<samp>289</samp>'.

Also note that by carefully arranging the columns so the second is increasing, the first going up and jumping down, and the last going down and jumping up, no duplicates are printed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://165855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-23 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found