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

1 of 4
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

Haskell, 175 bytes

t=take 16
f=t0ドル:f
p s(a:b)=s%(a:a:b)
s%(a:b:c:d)=s(4*a+2*b+c):s%(b:c:d)
s%[a,b]=[s6ドル*a+b]
n=putStrLn
m s=n"P3 33 16 1">>mapM_((n"0 0">>).print)`mapM_`t(iterate(p(s!!))$f++1:f)

Try it online!

Outputs to a ppm file with blue being on and black being off. You can adjust the colors somewhat but blue is the golfiest of the primary colors.

Sample outputs

Rule 30

Rule 121

Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

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