21.01.2013, 00:06
Quote:
Well I'm not sure how efficient it is, but anyway:
pawn Код:
This code will create a random number from 0 to the length of szAlphabet (which decreases for every loop), then it will format the string szResult with whatever letter is at the position the random number is (for example if the random number is 5, then the character positioned at cell 5 (character #6) in szAlphabet will be added to szResult). After that, it will delete the already added character from the szAlphabet string, making it impossible for that character to being picked again. This whole thing will loop until szResult has reached its maximum length. |