It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!
Walking words
Walking words are words which will respond to certain characters. For the purpose of this challenge the trigger characters are [u, d, r, l]
from up down right left
.
Whenever you encounter such a character when printing text, you will move the direction of the text.
For example, the text abcdef
will result in:
abcd
e
f
Rules
- Both uppercase
UDRL
and lowercaseudrl
should change the direction, but case should be preserved in the output - Input will only contain printable characters
(0-9, A-Z, a-z, !@#%^&*() etc...)
, no newlines! - Whenever the text will collide, it will overwrite the old character at that position
- Output should be presented to the user in any fashionable matter, but it should be a single output (no array of lines)
- Trailing and leading newlines are allowed
- Trailing spaces are allowed
- Standard loopholes apply
Test cases
empty input => empty output or a newline
u =>
u
abc =>
abc
abcd =>
abcd
abcde =>
abcd
e
abcdde =>
abcd
d
e
codegolf and programming puzzles =>
cod
e
g
o
dna fl sel
z
p z
rogramming pu
ABCDELFUGHI =>
I
AHCD
G E
UFL
It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>
dnats taht noinipo el
a b
rd m
It is in my hu
t
e
x
t
i
s
b
o
ring. Therefore I propose a new writing stand
a
rd
,
w
a
rdw gnikl
s
!
This is code-golf, shortest code in bytes wins!
golf
look by itself? \$\endgroup\$gfl
\$\endgroup\$