Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

3 of 5
Added information
ErikF
  • 4.8k
  • 9
  • 11

C (gcc), (削除) 169 (削除ここまで) 166 bytes

Thanks to ceilingcat for the suggestions! I also changed the newlines in the header to spaces as they seem to work fine as separators (at least in Irfanview) and fixed a bug that got revealed when the array was put on the stack.

Generates an image in PBM format, as it's probably the simplest way to make a bitmap! For some reason, all the online PBM viewers that I tried don't seem to like the output file, but Irfanview and GIMP are fine with it.

f(r,w){char s[(w=r*2+11)*w+1];float x=0;for(memset(s,48,w*w),s[w*w]=0;x<7;x+=1e-5)s[(int)(round(sin(x)*r+r+5)+round(cos(x)*r+r+5)*w)]=49;printf("P1 %d %d %s",w,w,s);}

Try it online!

ErikF
  • 4.8k
  • 9
  • 11

AltStyle によって変換されたページ (->オリジナル) /