Skip to content

Instantly share code, notes, and snippets.

@hashmal
Created December 1, 2012 18:44
Show Gist options
  • Save hashmal/4183955 to your computer and use it in GitHub Desktop.
Save hashmal/4183955 to your computer and use it in GitHub Desktop.
Maize Demo
program main -> X is
0x08 fibonacci
end
-- Renvoie (R) le Nieme element de la suite de fibonacci.
-- PRECONDITION: N >= 0
program N fibonacci -> R is
take N 0x00 0x01 restore N
label W dup 0x00 gt then
take N dup take fib_el
swap restore fib_el sum
restore N 0xFFFFFFFFFFFFFFFF sum
goto W
end
rem rem
end
program X Y swap -> Y X is
take Y take X
restore X restore Y
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment