Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias scramble {
- wordscramble $1-
- letterscramble
- set %scrambledword $replace($1,%scram,$right(%scram,1))
- return %scramble.rstring
- }
- alias letterscramble {
- tokenize 32 %scramble.rstring
- var %i 1
- :top
- set %scramble.wordcount $numtok(%scramble.rstring,32)
- set %scramble.word $($+($,%i),2)
- set %scramble.lettercount $len(%scramble.word)
- if (%scramble.lettercount > 1) {
- while (%scramble.lettercount >= 1) {
- set %scramble.rletter $right(%scramble.word,$r(1,%scramble.lettercount))
- set %scramble.rword %scramble.rword $+ %scramble.rletter
- set %scramble.word $removecs(%scramble.word,%scramble.letter)
- dec %scramble.lettercount
- }
- }
- else {
- set %scramble.rword %scramble.word
- }
- }
- alias wordscramble {
- unset %scramble.*
- set %scramble.string $1-
- set %scramble.wordcount $numtok(%scramble.string,32)
- if (%scramble.wordcount > 1) {
- while (%scramble.wordcount >= 1) {
- tokenize 32 %scramble.string
- set %scramble.rnum $r(1,%scramble.wordcount)
- set %scramble.rword $($+($,%scramble.rnum),2)
- set %scramble.rstring %scramble.rstring %scramble.rword
- set %scramble.string $deltok(%scramble.string,%scramble.rnum,32)
- dec %scramble.wordcount
- }
- echo -a %scramble.rstring
- }
- else {
- set %scramble.rstring %scramble.string
- echo -a %scramble.rstring
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement