Befunge-98 - 26 22 21
Befunge-98 - 26 22 21 19
~:d3*''-d2*/1-!"' "*+*+,#@
Basically, it does putchar((c = getc()) + (c > '@' && !(c > 'Z'))*' ')
, pretending for a moment that the assignment to c
is guranteed to happen first and that I got the nesting of parentheses right...
Now, instead it reliesRelies on the fact that (c-39)/26
is 1
only for character codes of uppercase ASCII characters (assuming integer division). So instead For each character c
, I print out c + (((c-39)/26)==1)*' '
for each character c
.
Sample session:
% cfunge lower.b98
hello WORLD!
hello world!
This is a TEST!!11 az AZ @[`{
this is a test!!11 az az @[`{