Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Simple Math Puzzle...

by hv (Prior)
on May 10, 2003 at 12:43 UTC ( [id://257121]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      for my $i (0 .. $#digits) {
        for my $j (0 .. $#digits) {
    ...
          ++$flag if $digit[$i] == $digit[$j];
        }
      }
    
  2. or download this
      for my $i (0 .. $#digits) {
        for my $j ($i + 1 .. $#digits) {
          ++$flag if $digits[$i] == $digits[$j];
        }
      }
    
  3. or download this
      sub check_duplicates {
        my $candidate = shift;
        ++$flag if $candidate =~ /(.).*\1/;
      }
    
  4. or download this
      sub check_prime {
        my $candidate = shift;
        ++$flag if 2 != $candidate =~ tr/2357//;
      }
    
  5. or download this
      for (my $candidate = 10234; $candidate <= 98765; ++$candidate) {
        # we want to jump eg from 10992 to 11000
    ...
        }ex;
        ...
      }
    
  6. or download this
      print "$candidate\n" unless $bad;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-03-29 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found