Abelian sandpile model: Difference between revisions
m
→{{header|ALGOL 68}}: bug fix
imported>RegalCode (Implementation for Abelian sand pile) |
m (→{{header|ALGOL 68}}: bug fix) |
||
(One intermediate revision by one other user not shown) | |||
Line 69:
simulate(&grid)
V ppm = File(‘sand_pile.ppm’,
ppm.write_bytes(("P6\n#. #.\n255\n".format(grid.len, grid.len)).encode())
V colors = [[Byte(0), 0, 0],
Line 377:
BEGIN
INT result := s[ 1 LWB s, 2 LWB s ];
FOR i FROM 1 LWB s TO
FOR j FROM 2 LWB s TO 2 UPB s DO
IF s[ i, j ] > result THEN result := s[ i, j ] FI
|