Abelian sandpile model: Difference between revisions
Content added Content deleted
(Forth solution) |
|||
Line 65: | Line 65: | ||
: inc-stack 2cells stack +! ; |
: inc-stack 2cells stack +! ; |
||
⚫ | |||
: stack-empty? stack @ bottom u< ; |
: stack-empty? stack @ bottom u< ; |
||
: stack-full? stack-empty? invert ; |
: stack-full? stack-empty? invert ; |
||
⚫ | |||
: peek assert( stack-full? ) stack @ 2@ ; |
: peek assert( stack-full? ) stack @ 2@ ; |
||
: pop peek dec-stack ; |
: pop peek dec-stack ; |