Examples

Fibonacci

fib.hd

func calculate(n int64) -> int64
    if((n is 0) or (n is 1))
        put n
    end
    
    put fib(n-1) + fib(n-2)
end

main.hd

with fib from fib.hd
with console from std:io
with Int fixed from std:int

fib.calculate(parse(value=console.in(),raise=false,defaultValue=0))

Perceptron

Factorial

main.hd

Last updated