Avoiding digits is not really challenging in a language without digits, but I found it interesting which strategy would give the shortest code.
The straight forward loop takes 66 bytes:
. . -- - - - -.- -. --- . - .- - - . .--..-.- .- --.. --. - .- --.
. .
to E
nter 0
-- -
to M
ark the current program position
- - -.- -.
dup and K
onvert to N
umber
---
to O
utput
. - .-
to E
nter 1 and A
dd
- - . .--..-.- .-
dup, E
nter -101 and A
dd
--.. --.
to Z
eroskip until next --.
- .- --.
drop the unused difference and G
o to marked position
Two more bytes can be saved by using an empty token as target for the Zeroskip (note the essential trailing space!): . . -- - - - -.- -. --- . - .- - - . .--..-.- .- --.. - .- --.
(64 bytes)
Counting down is usually cheaper, but here we need to concatenate the numbers to a string to show them in the correct order (70 bytes):
. . --..-.- -- - . .- .- - - - .. -.-. .. - . --.. --. -.- -. ---
.
to E
nter an empty cell on the stack as the string to build
. --..-.-
to E
nter 101 so we can start the loop by decrementing
-- -
to M
ark the start of the loop
. .- .-
decrement by A
dding -1
- - - .. -.-. ..
dup, rot the string to the top and C
oncatenate the cells with a space in between
- . --.. --.
swap to get the index to the top and do a Z
eroskip the the G
o command that closes the loop
-.- -. ---
to K
onvert the whole string to N
umber and O
utput
An unusual trick takes us down to 61 bytes: Counting up from -101 to 0 and directly outputting the index+101:
. .--..-.- -- - - - . --..-.- .- -.- -. --- . - .- --.. --.
I found no way to mitigate E
ntering the 101 twice without wasting the bytes for stack juggling.
Finally, the best solution with 60 bytes turned out to be defining a recursive command (I used the undefined command -.
):
. - - --.. -. . .- .- -. -.- -. --- . -. .-- . --..-.. -.
. [command] . -. .--
to E
nter the command and W
rite it to address -.
. --..-.. -.
to E
nter 100 and call the new command
- The command itself is
- - --.. -.
dup and Z
eroskip to the self-calling -.
. .- .-
decrement by A
dding -1
-.
call itself with the decremented value
-.- -. ---
to K
onvert to N
umber and O
utput. As this is done after calling itself, it is done first for the 0 case, to resorting is done automatically
eX
ecuting the command directly from the stack . --..-.. . - - --.. -..- . .- .- . .- -..- -.- -. --- -..-
save nine bytes for saving the command, but wastes three time the two bytes that -..-
is longer than -.
and five more bytes for placing .-
on the stack to eX
ecute A
gain, ending in 62 bytes.
I hope this illustrates why I like morsecco as a golfing language: There are many ways to do something and a lot of tricks to discover. The pure score is not impressing, but considering that you could pack 5 characters into one byte (3^5 = 243 < 256), 12 true bytes even beat some golfing languages!
0
. Which is what makes this challenge interesting, IMO. \$\endgroup\$