summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA/writeup2/examples/fib/rust
diff options
context:
space:
mode:
authorthing 1 <thing1@seacrossedlovers.xyz>2024-12-16 13:36:15 +0000
committerthing 1 <thing1@seacrossedlovers.xyz>2024-12-16 13:36:15 +0000
commit857de9681685bc5cfd3907ccfe87d8a9b160b968 (patch)
treea2e88494c3931fc4946f6fc4fda1d5f4d9f63247 /comp/lucas-standen-NEA/writeup2/examples/fib/rust
parent03625304e740c9c0f7c434833dcded7ecdb9ca99 (diff)
created example
Diffstat (limited to 'comp/lucas-standen-NEA/writeup2/examples/fib/rust')
-rwxr-xr-xcomp/lucas-standen-NEA/writeup2/examples/fib/rust/fibbin0 -> 420600 bytes
-rw-r--r--comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs11
2 files changed, 11 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib
new file mode 100755
index 0000000..39c0328
--- /dev/null
+++ b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib
Binary files differ
diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs
new file mode 100644
index 0000000..13ed7e9
--- /dev/null
+++ b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs
@@ -0,0 +1,11 @@
+fn fib(n: i32) -> i32 {
+ if n < 2 {
+ return n;
+ }
+ return fib(n - 1) + fib(n - 2);
+}
+
+fn main(){
+ let val = fib(10);
+ println!("{val}");
+}