Skip to main content
added 38 characters in body
Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

><>, 8989 86 + 3 = 9289 bytes

:&"$$"{\\l?!;o70.
}-1v!?:<{"}"
&:&\~"stodd"&&\~"stod"&:&?!~:
{1->:?!v}"\+1{1carfc"
rav\$$"\~"\+1=ihp
  o;!?l<

Run with the -v flag, e.g.

py -3 fish.py program.fish -v 3

Surprisingly ><> doesn't do too badly here, since we can mimic string multiplication by having a counter which we decrement every iteration.

:&"$$"{\                     Put n into the register and push "$$"
}-1v!?:<{"}"                 Push n "}"s
&:&\~"stodd"&&\~"stod"&:&?!~:             Push "stodd""stod", and popcopy the final "d" if n ==!= 0
{1->:?!v}"\+1{1carfc"        Push n "\+1{1carfc"s
rav\$$"\~"\+1=ihp            Push "\+1=ihprav\$$"
  o;!?l<        \l?!;o70.             Keep printing chars until the stack is empty

(-3 bytes thanks to @randomra)

><>, 89 + 3 = 92 bytes

:&"$$"{\
}-1v!?:<{"}"
&:&\~"stodd"&:&?!~
{1->:?!v}"\+1{1carfc"
rav\$$"\~"\+1=ihp
  o;!?l<

Run with the -v flag, e.g.

py -3 fish.py program.fish -v 3

Surprisingly ><> doesn't do too badly here, since we can mimic string multiplication by having a counter which we decrement every iteration.

:&"$$"{\                     Put n into the register and push "$$"
}-1v!?:<{"}"                 Push n "}"s
&:&\~"stodd"&:&?!~           Push "stodd", and pop the final "d" if n == 0
{1->:?!v}"\+1{1carfc"        Push n "\+1{1carfc"s
rav\$$"\~"\+1=ihp            Push "\+1=ihprav\$$"
  o;!?l<                     Keep printing chars until the stack is empty

><>, 89 86 + 3 = 89 bytes

:&"$$"{\l?!;o70.
}-1v!?:<{"}"
&:&\~"stod"&:&?:
{1->:?!v}"\+1{1carfc"
rav\$$"\~"\+1=ihp

Run with the -v flag, e.g.

py -3 fish.py program.fish -v 3

Surprisingly ><> doesn't do too badly here, since we can mimic string multiplication by having a counter which we decrement every iteration.

:&"$$"{\                     Put n into the register and push "$$"
}-1v!?:<{"}"                 Push n "}"s
&:&\~"stod"&:&?:             Push "stod", and copy the final "d" if n != 0
{1->:?!v}"\+1{1carfc"        Push n "\+1{1carfc"s
rav\$$"\~"\+1=ihp            Push "\+1=ihprav\$$"
       \l?!;o70.             Keep printing chars until the stack is empty

(-3 bytes thanks to @randomra)

Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

><>, 89 + 3 = 92 bytes

:&"$$"{\
}-1v!?:<{"}"
&:&\~"stodd"&:&?!~
{1->:?!v}"\+1{1carfc"
rav\$$"\~"\+1=ihp
  o;!?l<

Run with the -v flag, e.g.

py -3 fish.py program.fish -v 3

Surprisingly ><> doesn't do too badly here, since we can mimic string multiplication by having a counter which we decrement every iteration.

:&"$$"{\                     Put n into the register and push "$$"
}-1v!?:<{"}"                 Push n "}"s
&:&\~"stodd"&:&?!~           Push "stodd", and pop the final "d" if n == 0
{1->:?!v}"\+1{1carfc"        Push n "\+1{1carfc"s
rav\$$"\~"\+1=ihp            Push "\+1=ihprav\$$"
  o;!?l<                     Keep printing chars until the stack is empty