in reply to Algorithm for "Incrementing" strings
It's so simple it doesn't even need a sub:
#!/usr/bin/perl use strict; use warnings; my $consonants = 'BCDFGHJKLMNPQRSTVWXZ'; my @letters = split //, $consonants; my ($first, $last) = @letters[0, -1]; my %next; @next{'', @letters} = @letters; my $x = 'B'; for (1..450) { print "$x "; $x =~ s/([^$last]?)($last*)$/ $next{$1} . $first x length $2/ e; } print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Algorithm for "Incrementing" strings
by Anonymous Monk on Feb 14, 2015 at 17:51 UTC | |
|
Re^2: Algorithm for "Incrementing" strings
by Anonymous Monk on Feb 14, 2015 at 05:21 UTC | |
by tye (Sage) on Feb 15, 2015 at 03:51 UTC |