Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
5 Bugfix (Find should have been Count)
source | link

Charcoal, 29 27 20 19 bytes

FS«F⌕rdlu↧ι≔ιω✳∨ωrιFS«F№rdlu↧ι≔ιω✳∨ωrι

Try it online!Try it online! Link is to verbose version of code. Explanation:

FS«

Loop over the input characters.

F⌕rdlu↧ιF№rdlu↧ι

If the current letter is a direction...

≔ιω

then update the current walking direction.

✳∨ωrι

Print the character in the current walking direction, defaulting to right if no direction has been set yet.

Charcoal, 29 27 20 19 bytes

FS«F⌕rdlu↧ι≔ιω✳∨ωrι

Try it online! Link is to verbose version of code. Explanation:

FS«

Loop over the input characters.

F⌕rdlu↧ι

If the current letter is a direction...

≔ιω

then update the current walking direction.

✳∨ωrι

Print the character in the current walking direction, defaulting to right if no direction has been set yet.

Charcoal, 29 27 20 19 bytes

FS«F№rdlu↧ι≔ιω✳∨ωrι

Try it online! Link is to verbose version of code. Explanation:

FS«

Loop over the input characters.

F№rdlu↧ι

If the current letter is a direction...

≔ιω

then update the current walking direction.

✳∨ωrι

Print the character in the current walking direction, defaulting to right if no direction has been set yet.

4 added 2 characters in body
source | link

Charcoal, 29 27 2020 19 bytes

≔rθFS«F⌕rdlu↧ι≔ιθ✳θιFS«F⌕rdlu↧ι≔ιω✳∨ωrι

Try it online!Try it online! Link is to verbose version of code. Explanation:

≔rθ

Initialise the walking direction to horizontal.

FS«

Loop over the input characters.

F⌕rdlu↧ι

If the current letter is a direction...

≔ιθ≔ιω

then update the current walking direction.

✳θι✳∨ωrι

Print the character in the current walking direction, defaulting to right if no direction has been set yet.

Charcoal, 29 27 20 bytes

≔rθFS«F⌕rdlu↧ι≔ιθ✳θι

Try it online! Link is to verbose version of code. Explanation:

≔rθ

Initialise the walking direction to horizontal.

FS«

Loop over the input characters.

F⌕rdlu↧ι

If the current letter is a direction...

≔ιθ

then update the current walking direction.

✳θι

Print the character in the current walking direction.

Charcoal, 29 27 20 19 bytes

FS«F⌕rdlu↧ι≔ιω✳∨ωrι

Try it online! Link is to verbose version of code. Explanation:

FS«

Loop over the input characters.

F⌕rdlu↧ι

If the current letter is a direction...

≔ιω

then update the current walking direction.

✳∨ωrι

Print the character in the current walking direction, defaulting to right if no direction has been set yet.

3 added 139 characters in body
source | link

Charcoal, 29 2727 20 bytes

≔⊟⟦→⟧θFS«≔§⟦+✳θ⟧⌕rdlu↧ιθ✳θι≔rθFS«F⌕rdlu↧ι≔ιθ✳θι

Try it online!Try it online! Link is to verbose version of code. Explanation:

≔⊟⟦→⟧θ≔rθ

Initialise the walking direction to horizontal.

FS«

Loop over the input characters.

≔§⟦+✳θ⟧⌕rdlu↧ιθF⌕rdlu↧ι

Index into the new direction using the index ofIf the current lowercase letter in the string rdluis a direction. If it matches,..

≔ιθ

then take the direction automatically expanded from + into the four directions, otherwise default toupdate the current walking direction.

✳θι

Print the character in the current walking direction.

Charcoal, 29 27 bytes

≔⊟⟦→⟧θFS«≔§⟦+✳θ⟧⌕rdlu↧ιθ✳θι

Try it online! Link is to verbose version of code. Explanation:

≔⊟⟦→⟧θ

Initialise the walking direction to horizontal.

FS«

Loop over the input characters.

≔§⟦+✳θ⟧⌕rdlu↧ιθ

Index into the new direction using the index of the current lowercase letter in the string rdlu. If it matches, then take the direction automatically expanded from + into the four directions, otherwise default to the current direction.

✳θι

Print the character in the current walking direction.

Charcoal, 29 27 20 bytes

≔rθFS«F⌕rdlu↧ι≔ιθ✳θι

Try it online! Link is to verbose version of code. Explanation:

≔rθ

Initialise the walking direction to horizontal.

FS«

Loop over the input characters.

F⌕rdlu↧ι

If the current letter is a direction...

≔ιθ

then update the current walking direction.

✳θι

Print the character in the current walking direction.

2 added 139 characters in body
source | link
1
source | link