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

Programmer Humor

19480 readers
175 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 10 points 4 months ago (5 children)
[–] [email protected] 9 points 4 months ago* (last edited 4 months ago) (1 children)

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

[–] [email protected] 14 points 4 months ago (1 children)

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.

[–] [email protected] 14 points 4 months ago

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

[–] [email protected] 6 points 4 months ago (1 children)
[–] [email protected] 4 points 4 months ago

Chad quantised rust

[–] [email protected] 1 points 4 months ago

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

[–] [email protected] 1 points 4 months ago

Never use floats.