bqn-graphics/examples/gcdgrid.bqn

12 lines
458 B
BQN
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

bqngraphics"../"
Viridis•Import bqngraphics"colormaps.bqn"
HSVtoRGB•Import bqngraphics"colors.bqn"
PBM,PGM,PPM•Import bqngraphics"pnm.bqn"
# https://susam.net/blog/gcd-grid.html
GCDGrid•math.GCD˜
•Out PBM 1GCDGrid 50
#•Out PGM GCDGrid 20
#•Out PPM {⌊255×HSVtoRGB⎉1⍉(360×𝕩÷1+⌈˝𝕩)∾(2∾≢𝕩)⥊1}GCDGrid 20
#•Out PPM ⌊255×> Viridis¨ (⊢÷⌈´∘⥊) GCDGrid 20