Skip to content

Instantly share code, notes, and snippets.

@lukakostic
Last active August 26, 2018 19:41
Show Gist options
  • Save lukakostic/9971d2518351623818e264af5ae5e5e0 to your computer and use it in GitHub Desktop.
Save lukakostic/9971d2518351623818e264af5ae5e5e0 to your computer and use it in GitHub Desktop.
#define n double
n l=25; //Change this
#define p(X) putchar("* \n"[X])
#define f(X,Y) for(n X=0;X<l;p(Y)){X++;
n g(n z){return z==1?0:(z==2?1:g(z-1)+2);}void main(){n o=0.5;n h=l*o;f(i,2)n d=i>h?g(l-i+1):g(i);
n s=(l-d)*o;f(j,(j==h+o)?(j<=(s+o)?0:1):(j<=h?(j<(s+o)?0:1):((l+1-j)<(s+o)?0:1)))}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment