ai-free / examples /forth /sum.fs
SNAPKITTYWEST's picture
October 2026 main drop: mirror from GitHub
f5deffb verified
Raw History Blame Contribute Delete
119 Bytes
\ Sum 0 + 1 + ... + n, recursively. Halts with 55 on the stack.
: SUM ( n -- sum ) DUP IF DUP 1 - SUM + THEN ;
10 SUM