# Search Results

Results tagged with Search options user 38525
5 results

This challenge involves creating or parsing pictures using text characters as the paint. Typically this uses only 95 printable (from a total of 128) characters defined by the ASCII Standard from 1963.

C, 138 bytes j,k,l;t(i){l=2*i;char*c=calloc(l,l);memset(c,10,l*(l-2));for(;k<i;++k)for(j=k;j<l-1-k;)memset(c+j++*l+k,"+0*"[(i-k)%3],l-2*k-1);puts(c);} Function t taking one integer parameter - the …
answered Sep 11 '15 by pawel.boczarski
Bash, 126 109 87 chars 87: q()(printf %$[9+$1%9]s\\n $[$2*$2];[ 7 -lt$1 ]||(q $[$1+1] ${2}1;q$[$1+9]$2)) q 0 1 As it usually goes, changing from iterative to recursive solution helps us win add …
answered Apr 11 '15 by pawel.boczarski
Octave, 776 688 bytes 688: functions inlined into main loop (both were used only once), used cell notation {'foo','bar'}{i} in place of slightly longer ['foo';'bar'](i,:) Still none of bonuses im …
answered Aug 23 '15 by pawel.boczarski
Octave, 85 chars function r=p(s)i=j=0;for b=s k=b==40;k&&++j;t(j,++i)=9-k;k||--j;r=char(t+32);end;end It's an optimization of the naïve approach, which is actually pretty natural for Matlab and Oct …
answered Apr 20 '15 by pawel.boczarski
C, 176 bytes C is not going to win this, but the fun is worth it. #define A(x,y)for(j=x;j--;)putchar("# "[i+1>x]);printf(i?" ":" "#y" "); i;j;main(a,b,c){for(c=scanf("%d %d",&a,&b);a*a+b*b>c*c;c++ …
answered Sep 2 '15 by pawel.boczarski