514
Happens all the time (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] trxxruraxvr@lemmy.world 11 points 5 months ago
[-] ParanoiaComplex@lemmy.world 9 points 5 months ago* (last edited 5 months ago)

I don't know Rust but jump typically moves the program counter, where the height represents the number of instructions to move

[-] trxxruraxvr@lemmy.world 14 points 5 months ago

Afaik rust doesn't have functions like that as they lead to unsafe code that's impossible to check variable lifetimes for. I think OP created the jump function.

[-] RustyNova@lemmy.world 14 points 5 months ago

They created it. The compiler says the jump function is in src/main.rs

[-] Klaymore@sh.itjust.works 6 points 5 months ago
[-] fossphi@lemm.ee 4 points 5 months ago

Chad quantised rust

[-] crispy_kilt@feddit.de 1 points 5 months ago

Never use floats.

[-] SatouKazuma@programming.dev 1 points 5 months ago

But then wouldn't it be fly(height: f64) instead of jump(height: i32)?

this post was submitted on 13 Jun 2024
514 points (98.7% liked)

Programmer Humor

19572 readers
1640 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS