orange has asked for the wisdom of the Perl Monks concerning the following question:
the output is 81#!/usr/bin/perl use strict; my $str = "aabceezazerrfde"; my $wanted = "aez"; my @values = (7,2,26); my $counter = 0; my $tot = 0; my $letter = ''; my $indx; while ($counter < length($str) ) { $letter = substr($str, $counter, 1); $indx = index($wanted, $letter); if ( $indx != -1 ) { $tot = $tot + $values[$indx]; } $counter++; } print $tot;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: numerology experiment
by toolic (Bishop) on Nov 26, 2007 at 16:04 UTC | |
|
Re: numerology experiment
by kyle (Abbot) on Nov 26, 2007 at 16:27 UTC | |
|
Re: numerology experiment
by TheForeigner (Initiate) on Nov 26, 2007 at 17:09 UTC | |
|
Re: numerology experiment
by RaduH (Scribe) on Nov 26, 2007 at 16:04 UTC | |
|
Re: numerology experiment
by GrandFather (Saint) on Nov 26, 2007 at 21:10 UTC | |
by toolic (Bishop) on Nov 26, 2007 at 21:24 UTC | |
by GrandFather (Saint) on Nov 26, 2007 at 21:41 UTC | |
|
Re: numerology experiment
by Anonymous Monk on Nov 26, 2007 at 21:44 UTC | |
|
Re: numerology experiment
by bobf (Monsignor) on Nov 27, 2007 at 05:25 UTC | |
|
Re: numerology experiment
by Muggins (Pilgrim) on Nov 29, 2007 at 11:33 UTC |