Post History
C (gcc), 56 bytes i;f(s,n)char*s,n;{for(;*s;s++)for(i=n;i--;putchar(*s));} Try it online! My attempt at recursion ended up at 61 bytes: o;f(s,n)char*s,n;{for(o=n;*s&&n--;putchar(*...
Answer
#1: Initial revision
# [C (gcc)], 56 bytes <!-- language-all: lang-c --> i;f(s,n)char*s,n;{for(;*s;s++)for(i=n;i--;putchar(*s));} [Try it online!][TIO-kte01ptp] [C (gcc)]: https://gcc.gnu.org/ [TIO-kte01ptp]: https://tio.run/##bc5NDoMgEAXgfU9BWIE/0ZruJu3aawhiOwmFRrQb49npoKYr34JMyPcmo8un1jEiDCIUTupXN2Y0wDL4UUAWIOS5TDPeHWBZwmeeEhJZkBLWiG5i7w4dE1@PvbwsF8YGwTulecGuEhilqtJbPtj2TYB2BMG5hB23xlpPvE484URPXO9nZQ3BhiC5xPre@3lWylpjzlYj8dt@xnHHVmspSDmp8KKpj8K/cnLRGn8 "C (gcc) – Try It Online" --- My attempt at recursion ended up at 61 bytes: o;f(s,n)char*s,n;{for(o=n;*s&&n--;putchar(*s));*s&&f(++s,o);} I still think there's probably a more elegant way to solve both loops with recursion, but I can't spot it...