From 857de9681685bc5cfd3907ccfe87d8a9b160b968 Mon Sep 17 00:00:00 2001 From: thing 1 Date: Mon, 16 Dec 2024 13:36:15 +0000 Subject: created example --- comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy (limited to 'comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy') diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy b/comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy new file mode 100644 index 0000000..adb2a71 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy @@ -0,0 +1,14 @@ +(defun fib int n:int) + (if (< n 2)) + (return n) + (endif) + + (return (+ (fib (- n 1)) (fib (- n 2)))) +(endfun) + +(defun main int) + (printstr "give me a number (bellow 30 if you want it to be quick): ") + (let n:int (readint)) + (printint (fib n)) + (printchar '\n') +(endfun) -- cgit v1.2.3