home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / pbc22b.zip / PBC$BAS.ZIP / SHUFFLES.BAS < prev    next >
BASIC Source File  |  1993-04-19  |  646b  |  17 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1993  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7. DECLARE FUNCTION RndI% (TopValue%)
  8.  
  9. SUB ShuffleSt (St$)
  10.    FOR tmp% = 1 TO LEN(St$)
  11.       posn% = RndI%(LEN(St$)) + 1
  12.       ch$ = MID$(St$, tmp%, 1)
  13.       MID$(St$, tmp%, 1) = MID$(St$, posn%, 1)
  14.       MID$(St$, posn%, 1) = ch$
  15.    NEXT
  16. END SUB
  17.