Deutsch English Français Italiano |
<65e9cad3$0$4689$882e4bbb@reader.netnews.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news-out.netnews.com!eu1.netnews.com!eu1.netnews.com!not-for-mail X-Trace: DXC=_iMFmX6S[DaO5da<66@17mHWonT5<]0TmdjI?Uho:XeklL51CP6LDLl95GMl]75=8a6i]c>P;b`]bXfi2cY2CcLiQUE_nj5jP;`LPH8bHEb=:j X-Complaints-To: support@blocknews.net Date: Thu, 7 Mar 2024 09:10:27 -0500 MIME-Version: 1.0 User-Agent: Betterbird (Windows) Newsgroups: comp.os.linux.advocacy Content-Language: en-US From: DFS <nospam@dfs.com> Subject: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Lines: 29 Message-ID: <65e9cad3$0$4689$882e4bbb@reader.netnews.com> NNTP-Posting-Host: 127.0.0.1 X-Trace: 1709820627 reader.netnews.com 4689 127.0.0.1:36105 Bytes: 1744 Original sentence: "Jumble this sentence then put it back in order." Simple coding requirements: has to be done in a loop parse the original sentence into words randomly jumble the words concatenate them with spaces to form a new sentence string print new sentence to screen parse the new sentence and restore it repeat I haven't started yet, but I figure it's about 5-8 lines in python. Too easy. So it has to be written in C. I'm the judge. I'm looking for 3 winning entries (including mine): 1) the fastest 2) the best 3) the fewest lines The best might be the simplest, or the shortest, or the most innovative use of C, etc. It's subjective, but I'll explain why I chose the best. Obviously, you can't use anyone else's submission for ideas or tips before submitting your own. If you win all 3 categories, you're cola's King Of The Jumble.