in reply to Re: Re: Re: Function over all letters in a string
in thread Function over all letters in a string
I found that part of the spec ambiguous and so made up a convenient definition.You also apparently made a convenient definition of the phrase "random number". :)
Personally, I'd like something that has a chance of producing a long string, but favouring shorter ones. Hence, a simple 1 + int rand 12 won't do. Rather, I'm tempted to use an exponential function:
Which, for example, prints$_ = 'cat'; s/(.)/$1 x int(12**rand)/ge; print;
caaatttttttt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Function over all letters in a string
by Abigail-II (Bishop) on Dec 01, 2003 at 11:21 UTC | |
|
Re: Re: Re: Re: Re: Function over all letters in a string
by tilly (Archbishop) on Dec 01, 2003 at 14:39 UTC |