Add GCD grid example
This commit is contained in:
parent
1496a0fd12
commit
9551806b17
4 changed files with 15 additions and 1 deletions
12
examples/gcdgrid.bqn
Normal file
12
examples/gcdgrid.bqn
Normal file
|
@ -0,0 +1,12 @@
|
|||
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 1≠GCDGrid 50
|
||||
#•Out PGM GCDGrid 20
|
||||
#•Out PPM {⌊255×HSVtoRGB⎉1⍉(360×𝕩÷1+⌈˝𝕩)∾(2∾≢𝕩)⥊1}GCDGrid 20
|
||||
#•Out PPM ⌊255×> Viridis¨ (⊢÷⌈´∘⥊) GCDGrid 20
|
Loading…
Add table
Add a link
Reference in a new issue