Skip to main content
Commonmark migration
Source Link

#C (219)

C (219)

Thanks to everyone for the golfing tips -- managed to get it down to 219. Don't think it'll go much lower.

w,W,s,S,i,r;main(){char T[78];memset(T,42,78);for(r=4,s=39;r<14;++r,s-=3,w+=6)for(i=0,S=s,W=w;i<r;++i,W+=2,--S)printf("%*s/%.*s\\\n",S,"",W,T);for(i=0;i<11;i++)printf("%35s|--------|\n","");printf("%35s|________|","");}

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#C (219)

Thanks to everyone for the golfing tips -- managed to get it down to 219. Don't think it'll go much lower.

w,W,s,S,i,r;main(){char T[78];memset(T,42,78);for(r=4,s=39;r<14;++r,s-=3,w+=6)for(i=0,S=s,W=w;i<r;++i,W+=2,--S)printf("%*s/%.*s\\\n",S,"",W,T);for(i=0;i<11;i++)printf("%35s|--------|\n","");printf("%35s|________|","");}

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

C (219)

Thanks to everyone for the golfing tips -- managed to get it down to 219. Don't think it'll go much lower.

w,W,s,S,i,r;main(){char T[78];memset(T,42,78);for(r=4,s=39;r<14;++r,s-=3,w+=6)for(i=0,S=s,W=w;i<r;++i,W+=2,--S)printf("%*s/%.*s\\\n",S,"",W,T);for(i=0;i<11;i++)printf("%35s|--------|\n","");printf("%35s|________|","");}

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Golf'd more, thanks for the tips!
Source Link

#C (263219)

Probably can be golfed moreThanks to everyone for the golfing tips -- managed to get it down to 219. Don't think it'll go much lower.

mainw,W,s,S,i,r;main(){char T[78];memset(T,'*'42,78);char S[39];memset;for(S,' ',39);int r=4,s=39,w=0,w2,s2,i;for(;r<14;++rs=39;r<14;++r,s-=3,w+=6)for(i=0,s2=sS=s,w2=w;i<r;++iW=w;i<r;++i,w2+=2W+=2,--s2S)printf("%.*s"%*s/%.*s\\\n",s2,S,w2"",W,T);for(i=0;i<11;i++) printf("%.35s|"%35s|--------|\n",S"");printf("%.35s|________|\n""%35s|________|",S"");}

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#C (263)

Probably can be golfed more.

main(){char T[78];memset(T,'*',78);char S[39];memset(S,' ',39);int r=4,s=39,w=0,w2,s2,i;for(;r<14;++r,s-=3,w+=6)for(i=0,s2=s,w2=w;i<r;++i,w2+=2,--s2)printf("%.*s/%.*s\\\n",s2,S,w2,T);for(i=0;i<11;i++) printf("%.35s|--------|\n",S);printf("%.35s|________|\n",S);}

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#C (219)

Thanks to everyone for the golfing tips -- managed to get it down to 219. Don't think it'll go much lower.

w,W,s,S,i,r;main(){char T[78];memset(T,42,78);for(r=4,s=39;r<14;++r,s-=3,w+=6)for(i=0,S=s,W=w;i<r;++i,W+=2,--S)printf("%*s/%.*s\\\n",S,"",W,T);for(i=0;i<11;i++)printf("%35s|--------|\n","");printf("%35s|________|","");}

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
golfed a bit more :-)
Source Link

#C (336) (276 without the required includes263)

Probably can be golfed more.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void main(){
 char T[78];memset(T,'*',78);char S[39];memset(S,' ',39);
int;int r=4,s=39,w=0,w2,s2,i;
fori;for(;r<14;++r,s-=3,w+=6)
 for(i=0,s2=s,w2=w;i<r;++i,w2+=2,--s2)
 printf("%.*s/%.*s\\\n",s2,S,w2,T);
for;for(i=0;i<11;i++) printf("%.35s|--------|\n",S);
printf;printf("%.35s|________|\n",S);
 }

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#C (336) (276 without the required includes)

Probably can be golfed more.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void main(){
 char T[78];memset(T,'*',78);char S[39];memset(S,' ',39);
int r=4,s=39,w=0,w2,s2,i;
for(;r<14;++r,s-=3,w+=6)
 for(i=0,s2=s,w2=w;i<r;++i,w2+=2,--s2)
 printf("%.*s/%.*s\\\n",s2,S,w2,T);
for(i=0;i<11;i++) printf("%.35s|--------|\n",S);
printf("%.35s|________|\n",S);
 }

#C (263)

Probably can be golfed more.

main(){char T[78];memset(T,'*',78);char S[39];memset(S,' ',39);int r=4,s=39,w=0,w2,s2,i;for(;r<14;++r,s-=3,w+=6)for(i=0,s2=s,w2=w;i<r;++i,w2+=2,--s2)printf("%.*s/%.*s\\\n",s2,S,w2,T);for(i=0;i<11;i++) printf("%.35s|--------|\n",S);printf("%.35s|________|\n",S);}

Required includes:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Source Link
Loading