Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ challenge #6001: FIOC

Name: Christopher 2017-10-21 9:05

Input: A four-letter ASCII string
Output: The phrase ``αorced αndendation αf αode'',
with the alphae replaced with the consecutive letters from the input, shifted to uppercase.
╔═══════════════════════════════════════════════
║Example 1: sicp -> Sorced Indendation Cf Pode
║Example 2: SUSS -> Sorced Undendation Sf Sode
╚═══════════════════════════════════════════════

Your entry has to be a
source code
of a complete program
that takes the input on stdin and outputs the string to stdout. Shortest program wins.

Name: Anonymous 2017-10-23 16:45

>>32
so for this dubspost I went with Racket, which I think is the most usable sort-of- Scheme.

the natural way of destructuring in racket would be through match-let:
(match-let([(list f i o c)(string->list(string-upcase(read-line)))])(printf"~aorced ~andentation ~af ~aode"f i o c))

...but abusing match gives us better results. would be better than Clojure if you could natively destructure strings (well, maybe you can; I think it's possible but I may be wrong).

(match(string->list(string-upcase(read-line)))[(list f i o c)(printf"~aorced ~andentation ~af ~aode"f i o c)])

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List