Abelian sandpile model/Identity: Difference between revisions

Content deleted Content added
Wherrera (talk | contribs)
Wherrera (talk | contribs)
Line 68: Line 68:
function Sandpile(s::String)
function Sandpile(s::String)
arr = [parse(UInt8, x.match) for x in eachmatch(r"\d+", s)]
arr = [parse(UInt8, x.match) for x in eachmatch(r"\d+", s)]
siz = Int(round(sqrt(length(arr))))
siz = isqrt(length(arr))
return Sandpile(reshape(UInt8.(arr), siz, siz)')
return Sandpile(reshape(UInt8.(arr), siz, siz)')
end
end