Post History
C (gcc), 153 bytes a,b;f(char*s){for(char*c,*o="idso";*s;s++)for(c=o;*c;c++)*s==*c&&(b=c-o,a+=!b,a-=b==1,b==2?a*=a:0,b==3&&printf("%d%c",a,s[1]?44:10),a==-1|a==256?a=0:0);} Tr...
Answer
#2: Post edited
# [C (gcc)], 155 bytes- <!-- language-all: lang-c -->
a,b;f(char*s){for(char*c,*o="idso";*s;s++)for(c=o;*c;c++)*s==*c&&(b=c-o,a+=!b,b==1&&a--,b==2?a*=a:0,b==3&&printf("%d%c",a,s[1]?44:10),a==-1|a==256?a=0:0);}[Try it online!][TIO-kkqoyhzh]- [C (gcc)]: https://gcc.gnu.org/
[TIO-kkqoyhzh]: https://tio.run/##jVDbUoMwEH3vV0ScMhCCJRSwNqb9EMeHkPSyM0ocQn2p/XZMoK2C4@gms3P27C0nMt5J2d5CJV8OaoMeTaNA3@1XrSAl2wZyL2pswuNW1z2WBGvugTLaY9gwE0Vhl@OaYcmkDbHhHEvfD0ouY01ExG9KUnJOfV/EsUPpWmAulonDc99/q6FqtoE3VVPpEUHME31eZ9mSJiERnMf0w/o0L9aCJ8skZKfW1qNXARUK3jWocHKcIDTD1gEYYzSKVyixkXIhGNUR6WJxLrDMX3Yd0c2Db9clKMlImpPiviBZvpinD7ZQOzOgwW6wqOsnl0MJLfrbPQHApSvd7KHanRlnxigYWzcpozR1Oy6vwjPr7I/1cr2Q2Z9hPXXVPGD/K3vYNNY@yI4Ej9YB/CB@VTgc@xXVm@ZQV8jiU/sJ "C (gcc) – Try It Online"- Function solution, misc gcc abuse.
- # [C (gcc)], 153 bytes
- <!-- language-all: lang-c -->
- a,b;f(char*s){for(char*c,*o="idso";*s;s++)for(c=o;*c;c++)*s==*c&&(b=c-o,a+=!b,a-=b==1,b==2?a*=a:0,b==3&&printf("%d%c",a,s[1]?44:10),a==-1|a==256?a=0:0);}
- [Try it online!][TIO-kkqp8em2]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kkqp8em2]: https://tio.run/##jVDbUoMwEH3vV0ScMpAGSyjF2pj2QxwfQtLLzihxWOpL7bdjgLYKjqObzM7u2etZHe20rm@h0C8HsyGPWBmwd/tVrVgutoHeq5JieNzasrM1o1Z6YNB6gqLAySRsY9IKqoV2LkUpqfb9IJc6skxN5E3OVCRzKTlzKlkrKtUybuyZ77@VUFTbwBubsfaYYvjEn9dpuuRxyJSUEf9wOplnayXjZRyKU@3yyauCggTvFkw4Oo4ImVKnABDRkmhFYueZxgU0LZAsFucEh/wl1xZtP/j2mwBnKUvmLLvPWDpfzJIHl2gbQbDgJjirrWeXxxnPut@uANCEC1vtodidkUYQDQyl7ZRynjQzLlvRqVPuYh1dLxTuMqKDrpx76H9p94uG3HvRAeHBOIAfwK8M@22/vHJTHcqCOPtUfwI "C (gcc) – Try It Online"
- Function solution, misc gcc abuse.
#1: Initial revision
# [C (gcc)], 155 bytes <!-- language-all: lang-c --> a,b;f(char*s){for(char*c,*o="idso";*s;s++)for(c=o;*c;c++)*s==*c&&(b=c-o,a+=!b,b==1&&a--,b==2?a*=a:0,b==3&&printf("%d%c",a,s[1]?44:10),a==-1|a==256?a=0:0);} [Try it online!][TIO-kkqoyhzh] [C (gcc)]: https://gcc.gnu.org/ [TIO-kkqoyhzh]: https://tio.run/##jVDbUoMwEH3vV0ScMhCCJRSwNqb9EMeHkPSyM0ocQn2p/XZMoK2C4@gms3P27C0nMt5J2d5CJV8OaoMeTaNA3@1XrSAl2wZyL2pswuNW1z2WBGvugTLaY9gwE0Vhl@OaYcmkDbHhHEvfD0ouY01ExG9KUnJOfV/EsUPpWmAulonDc99/q6FqtoE3VVPpEUHME31eZ9mSJiERnMf0w/o0L9aCJ8skZKfW1qNXARUK3jWocHKcIDTD1gEYYzSKVyixkXIhGNUR6WJxLrDMX3Yd0c2Db9clKMlImpPiviBZvpinD7ZQOzOgwW6wqOsnl0MJLfrbPQHApSvd7KHanRlnxigYWzcpozR1Oy6vwjPr7I/1cr2Q2Z9hPXXVPGD/K3vYNNY@yI4Ej9YB/CB@VTgc@xXVm@ZQV8jiU/sJ "C (gcc) – Try It Online" Function solution, misc gcc abuse.