Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
a couple of days ago i asked tou guys here for help and you delivered like gods so here i am again with another problem so pls help
Write a script which will do a simple scrambling of a string. The script should have variables for the original string (eg $message) and a number (eg $number) (which should be less than the length of the string). The scrambling should be achieved by reversing the first and last $number characters of $string (in that order). To avoid giving any hints as to the values used the scrambled string should appear all in lowercase.
For example:
String=Babraham Number=2, Scrambed= abbrahma String=Institute Number=3, Scrambled=snititetu
Hint: use the substr() and reverse() functions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Scrambling help
by ww (Archbishop) on Jan 25, 2015 at 21:23 UTC | |
|
Re: Scrambling help
by LanX (Saint) on Jan 25, 2015 at 20:55 UTC | |
by Anonymous Monk on Jan 25, 2015 at 21:07 UTC | |
by LanX (Saint) on Jan 25, 2015 at 21:09 UTC | |
by Anonymous Monk on Jan 25, 2015 at 21:12 UTC | |
|
Re: Scrambling help
by ohcamacj (Beadle) on Jan 27, 2015 at 20:49 UTC | |
by Anonymous Monk on Jan 27, 2015 at 21:53 UTC | |
|
Re: Scrambling help
by wee (Scribe) on Jan 29, 2015 at 22:08 UTC | |
|
Re: Scrambling help
by locked_user sundialsvc4 (Abbot) on Jan 26, 2015 at 15:43 UTC | |
by BillKSmith (Monsignor) on Jan 27, 2015 at 00:11 UTC |