Note that there are some explanatory texts on larger screens.

plurals
  1. POCode Golf - Word Scrambler
    text
    copied!<p>Please answer with the shortest possible source code for a program that converts an arbitrary plaintext to its corresponding ciphertext, following the sample input and output I have given below. Bonus points* for the least CPU time or the least amount of memory used.</p> <h2>Example 1:</h2> <p><strong>Plaintext:</strong> The quick brown fox jumps over the lazy dog. Supercalifragilisticexpialidocious!</p> <p><strong>Ciphertext:</strong> eTh kiquc nobrw xfo smjup rvoe eth yalz .odg !uioiapeislgriarpSueclfaiitcxildcos</p> <h2>Example 2:</h2> <p><strong>Plaintext:</strong> 123 1234 12345 123456 1234567 12345678 123456789</p> <p><strong>Ciphertext:</strong> 312 4213 53124 642135 7531246 86421357 975312468</p> <h2>Rules:</h2> <ol> <li>Punctuation is defined to be included with the word it is closest to.</li> <li>The center of a word is defined to be ceiling((strlen(word)+1)/2).</li> <li>Whitespace is ignored (or collapsed).</li> <li>Odd words move to the right first. Even words move to the left first.</li> </ol> <p>You can think of it as reading every other character backwards (starting from the end of the word), followed by the remaining characters forwards. Corporation => XoXpXrXtXoX => niaorCoprto.</p> <p>Thank you to those who pointed out the inconsistency in my description. This has lead many of you down the wrong path, which I apologize for. Rule #4 should clear things up.</p> <p>*Bonus points will only be awarded if Jeff Atwood decides to do so. Since I haven't checked with him, the chances are slim. Sorry.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload