From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: How to shuffle/jumble letters of a given word? Date: Sun, 28 Jun 2015 14:23:27 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <24d183ce-77b6-4fe1-a95e-0ff5ef72c7bd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 28 Jun 2015 21:22:07 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a3855fbfe1a666be9aefba0563039ed5"; logging-data="18933"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/h8LlxNFhhB7RxuudpwBj3dXflrj63IZo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: Cancel-Lock: sha1:iGJFGJyfYWX90PKGe4f0xkmPqqY= Xref: news.eternal-september.org comp.lang.ada:26518 Date: 2015-06-28T14:23:27-07:00 List-Id: On 06/28/2015 02:07 PM, Simon Wright wrote: > > Then, given a String, create an Elements array with each Key a new > random number and each Ch the corresponding character in the String; > sort it (which, since the Keys were random, is effectively a shuffle); > and return a String formed of the Chs in their new order. You could also just sort the String. -- Jeff Carter "Apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, the fresh water system, and public health, what have the Romans ever done for us?" Monty Python's Life of Brian 80