33
5
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!
4This format has a severe data loss problem...:p – Mukul Kumar – 2016-11-14T15:08:58.047
Are leading/trailing spaces allowed? – Arnauld – 2016-11-14T15:25:15.313
@Arnauld As long as they don't disturb the position of the characters they are. So most likely just trailing spaces – Bassdrop Cumberwubwubwub – 2016-11-14T15:34:25.857
Related – ETHproductions – 2016-11-14T15:56:44.097
1How would the output of the word
golf
look by itself? – gabe3886 – 2016-11-14T16:20:47.4872@gabe3886
gfl
– Bassdrop Cumberwubwubwub – 2016-11-14T16:50:34.690It seems you can change the accepted answer back to Charcoal again. ;p – Kevin Cruijssen – 2019-05-24T10:48:19.730