summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Clawsie <brad@b7j0c.org>2026-10-30 08:35:37 -0500
committerBrad Clawsie <brad@b7j0c.org>2026-10-30 08:35:37 -0500
commit9937dce696992c9765521a5820e21f5482a7a02c (patch)
treec2a226a169b5d33d2bde0c0dfca40fa1fb92289f
parentcbc3babb5326f38dd4c1c53bf8ad5b59dd72c0b5 (diff)
feat: ex2
commit cd4ab434ffd6af736b347055a641407a184afc8c Author: Brad Clawsie <brad@b7j0c.org> Date: Fri Oct 30 08:32:07 2026 -0500 ex2
-rw-r--r--ex2/Cargo.lock7
-rw-r--r--ex2/Cargo.toml6
-rw-r--r--ex2/src/main.rs10
3 files changed, 23 insertions, 0 deletions
diff --git a/ex2/Cargo.lock b/ex2/Cargo.lock
new file mode 100644
index 0000000..900fa72
--- /dev/null
+++ b/ex2/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "ex2"
+version = "0.1.0"
diff --git a/ex2/Cargo.toml b/ex2/Cargo.toml
new file mode 100644
index 0000000..c6a7358
--- /dev/null
+++ b/ex2/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "ex2"
+version = "0.1.0"
+edition = "2024"
+
+[dependencies]
diff --git a/ex2/src/main.rs b/ex2/src/main.rs
new file mode 100644
index 0000000..6341539
--- /dev/null
+++ b/ex2/src/main.rs
@@ -0,0 +1,10 @@
+fn velocity(start: u32, end: u32, time: u32) -> u32 {
+ if end < start {
+ panic!("end < start");
+ }
+ end - start / time
+}
+
+fn main() {
+ println!("{}", velocity(5,15,4));
+}