Skip to main content
Now even shorter
Source Link

C++ 353347

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));)o=o;o=o.substr(0,t)+(p+99)+&o[t+strlen+s+&o[t+strlen(p)];bzero])s=p+99;bzero(q=p,198);s=p+99;;}}}

Try it online!Try it online!

C++ 353

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));)o=o.substr(0,t)+(p+99)+&o[t+strlen(p)];bzero(q=p,198);s=p+99;}}}

Try it online!

C++ 347

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}}

Try it online!

Now even shorter
Source Link

C++ 356353

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[99]p[198],*q=p,r[99],*s=r;int*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));)o=o.substr(0,t)+r+&o[t+strlen+(p+99)+&o[t+strlen(p)];bzero(q=p,99);bzero(s=r,99198);;s=p+99;}}}

Try it online!Try it online!

C++ 356

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[99],*q=p,r[99],*s=r;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));)o=o.substr(0,t)+r+&o[t+strlen(p)];bzero(q=p,99);bzero(s=r,99);}}}

Try it online!

C++ 353

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));)o=o.substr(0,t)+(p+99)+&o[t+strlen(p)];bzero(q=p,198);s=p+99;}}}

Try it online!

Now even shorter
Source Link

C++ 357356

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[99],*q=p,r[99],*s=r;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(;~n=2;~(t=o.find(p,i+1));)o=o.substr(0,t)+r+&o[t+strlen(p)];bzero(q=p,99);bzero(s=r,99);n=2;;}}}

Try it online!Try it online!

C++ 357

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[99],*q=p,r[99],*s=r;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(;~(t=o.find(p,i+1));)o=o.substr(0,t)+r+&o[t+strlen(p)];bzero(q=p,99);bzero(s=r,99);n=2;}}}

Try it online!

C++ 356

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h>
#define N(x)o[i]);else if(n<x)o[i]==92?
#define O (o[++i]):o[i]==47?n++:
char p[99],*q=p,r[99],*s=r;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));)o=o.substr(0,t)+r+&o[t+strlen(p)];bzero(q=p,99);bzero(s=r,99);}}}

Try it online!

Now even shorter
Source Link
Loading
Now even shorter
Source Link
Loading
Now even shorter
Source Link
Loading
std::string is c++
Source Link
Loading
Now even shorter
Source Link
Loading
Now even shorter
Source Link
Loading
Commonmark migration
Source Link
Loading
added 472 characters in body
Source Link
Loading
Now even shorter
Source Link
Loading
Now even shorter
Source Link
Loading
deleted 4 characters in body
Source Link
Loading
deleted 3 characters in body
Source Link
Loading
deleted 3 characters in body
Source Link
Loading
deleted 4 characters in body
Source Link
Loading
Source Link
Loading