Skip to main content
Commonmark migration
Source Link

#C, 236 bytes

C, 236 bytes

char t[95][95],i=95;f(x,y,s,n,m){if(t[y][x]<33){m=~s+(1<<s);for(n=~m;n++<m;)t[y][x+n]='-',t[y+n][x]=n==0?'+':'|';if(s--)f(x+n,y,s),f(x-n,y,s),f(x,y+n,s),f(x,y-n,s);}}main(){memset(t,32,9025);f(47,47,5);while(i--)printf("%.95s\n",t[i]);}

Just building the character table recursively before displaying it.

Try it online!

Thanks @Neil for making me realize that the length of the branches follow an actual rule.

#C, 236 bytes

char t[95][95],i=95;f(x,y,s,n,m){if(t[y][x]<33){m=~s+(1<<s);for(n=~m;n++<m;)t[y][x+n]='-',t[y+n][x]=n==0?'+':'|';if(s--)f(x+n,y,s),f(x-n,y,s),f(x,y+n,s),f(x,y-n,s);}}main(){memset(t,32,9025);f(47,47,5);while(i--)printf("%.95s\n",t[i]);}

Just building the character table recursively before displaying it.

Try it online!

Thanks @Neil for making me realize that the length of the branches follow an actual rule.

C, 236 bytes

char t[95][95],i=95;f(x,y,s,n,m){if(t[y][x]<33){m=~s+(1<<s);for(n=~m;n++<m;)t[y][x+n]='-',t[y+n][x]=n==0?'+':'|';if(s--)f(x+n,y,s),f(x-n,y,s),f(x,y+n,s),f(x,y-n,s);}}main(){memset(t,32,9025);f(47,47,5);while(i--)printf("%.95s\n",t[i]);}

Just building the character table recursively before displaying it.

Try it online!

Thanks @Neil for making me realize that the length of the branches follow an actual rule.

Golfed a bit more
Source Link
dim
  • 8.6k
  • 1
  • 14
  • 21

#C, 241236 bytes

char t[95][95],i=95;f(x,y,s,n,m){if(t[y][x]==32t[y][x]<33){m=~s+(1<<s);for(n=~m;n++<m;){t[y][x+n]='-';t[y+n][x]=n==0',t[y+n][x]=n==0?'+':'|';}if'|';if(s--){f(x+n,y,s);f,f(x-n,y,s);f,f(x,y+n,s);f,f(x,y-n,s);}}}main(){memset(t,32,9025);f(47,47,5);while(i--)printf("%.95s\n",t[i]);}

Just building the character table recursively before displaying it.

Try it online!Try it online!

Thanks @Neil for making me realize that the length of the branches follow an actual rule.

#C, 241 bytes

char t[95][95],i=95;f(x,y,s,n,m){if(t[y][x]==32){m=~s+(1<<s);for(n=~m;n++<m;){t[y][x+n]='-';t[y+n][x]=n==0?'+':'|';}if(s--){f(x+n,y,s);f(x-n,y,s);f(x,y+n,s);f(x,y-n,s);}}}main(){memset(t,32,9025);f(47,47,5);while(i--)printf("%.95s\n",t[i]);}

Just building the character table recursively before displaying it.

Try it online!

Thanks @Neil for making me realize that the length of the branches follow an actual rule.

#C, 236 bytes

char t[95][95],i=95;f(x,y,s,n,m){if(t[y][x]<33){m=~s+(1<<s);for(n=~m;n++<m;)t[y][x+n]='-',t[y+n][x]=n==0?'+':'|';if(s--)f(x+n,y,s),f(x-n,y,s),f(x,y+n,s),f(x,y-n,s);}}main(){memset(t,32,9025);f(47,47,5);while(i--)printf("%.95s\n",t[i]);}

Just building the character table recursively before displaying it.

Try it online!

Thanks @Neil for making me realize that the length of the branches follow an actual rule.

Source Link
dim
  • 8.6k
  • 1
  • 14
  • 21

#C, 241 bytes

char t[95][95],i=95;f(x,y,s,n,m){if(t[y][x]==32){m=~s+(1<<s);for(n=~m;n++<m;){t[y][x+n]='-';t[y+n][x]=n==0?'+':'|';}if(s--){f(x+n,y,s);f(x-n,y,s);f(x,y+n,s);f(x,y-n,s);}}}main(){memset(t,32,9025);f(47,47,5);while(i--)printf("%.95s\n",t[i]);}

Just building the character table recursively before displaying it.

Try it online!

Thanks @Neil for making me realize that the length of the branches follow an actual rule.