Abelian sandpile model: Difference between revisions

Content added Content deleted
imported>Chinhouse
No edit summary
imported>Chinhouse
No edit summary
Line 2,532: Line 2,532:
color.purple, color.blue, color.navy]
color.purple, color.blue, color.navy]


rows = 64; rowRange = range(0, rows-1)
rows = 48; rowRange = range(0, rows-1)
cols = 96; colRange = range(0, cols-1)
cols = 72; colRange = range(0, cols-1)
particlesOfSand = rows * cols
particlesOfSand = rows * cols
divBase = particlesOfSand / (colors.len - 4)
divBase = particlesOfSand / (colors.len - 4)
Line 2,572: Line 2,572:
display(4).mode = displayMode.tile
display(4).mode = displayMode.tile
td = display(4)
td = display(4)
td.cellSize = 10 // size of cells on screen
td.cellSize = 640/48 // size of cells on screen
td.extent = [cols, rows]
td.extent = [cols, rows]
td.overlap = 0 // adds a small gap between cells
td.overlap = 0 // adds a small gap between cells
Line 2,605: Line 2,605:
key.get()
key.get()
</syntaxhighlight>
</syntaxhighlight>
[[File:800px-Miniscript_abelian_sandpille.png|800px|thumb|center|Image for 6144 particles grid 64x96]
[[File:Miniscript_abelian_sandpille.png|800px|thumb|center|Image for 3456 particles grid 48*72]]


=={{header|Nim}}==
=={{header|Nim}}==