[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Cookbook Inspired Equation Solver.



On Fri, Apr 28, 2000 at 03:42:41PM -0500, tayers@bridge.com wrote:
> I'm not positive what you mean by "any of those silly equations", but
> looking at your code you might mean "for any number of digits in the
> numerator up to 9" this returns all solutions.
> 
> perl -le'$,="\n";print grep{($_.$_*66)!~/(.).*\1|0/}10**$_..10**($_+1) for 0..3'
> 
> But judging by the output of your program, which is essentially no
> different than the original one-liner, you probably mean something
> else. Could you please clarify?
> 

There was another example at the beginning of the script:

use strict;
my $line = "ABCD / EFGHI == 1 / 66";
# my $line = "C + AWK + APL + GREP == PERL";
my @vals=1..9;


So, he means equations where letters substitute for numbers.  You often see
equations like these in puzzle magaines, especially equations where the
lettrs spell out meaningful words, like in his second example.


Ronald

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe