Skip to main content
2 of 8
put console output in codeblock

Mumps, 80

r a q:'(a?1A0.1".")  f i=$A(a)+1:1:$S($A(a)<91:90,1:122) {w $C(32,i) w:a["." !}

Not such a modern language ;) I'm sure there's a bit of optimization space left..

Explanation:

r a 

read console input into a

q:'(a?1A0.1".")  

pattern match to follow 'wrong input rule'

f i=$A(a)+1:1:$S($A(a)<91:90,1:122) {w $C(32,i) w:a["." !}

basic for loop from the ascii value of the first character of input ($A(a)) in steps of 1 to either 91 (lower case) or 122 (upper case) output, and conditional output of newlines (!)

tests:

USER>d ^golf
 e. f
 g
 h
 i
 j
 k
 l
 m
 n
 o
 p
 q
 r
 s
 t
 u
 v
 w
 x
 y
 z
 
USER>d ^golf
r s t u v w x y z
USER>d ^golf
e.
 f
 g
 h
 i
 j
 k
 l
 m
 n
 o
 p
 q
 r
 s
 t
 u
 v
 w
 x
 y
 z
USER>d ^golf
hallo
USER>

(you'll need a mumps runtime env, ie Caché to run this this)

edit: bold heading