Klaymore@sh.itjust.works to Programmer Humor@programming.devEnglish · 3 months agoHappens all the timesh.itjust.worksimagemessage-square22fedilinkarrow-up1520arrow-down17
arrow-up1513arrow-down1imageHappens all the timesh.itjust.worksKlaymore@sh.itjust.works to Programmer Humor@programming.devEnglish · 3 months agomessage-square22fedilink
minus-squaretrxxruraxvr@lemmy.worldlinkfedilinkarrow-up13arrow-down3·3 months agoHeight should be a float
minus-squareSatouKazuma@programming.devlinkfedilinkarrow-up1·3 months agoBut then wouldn’t it be fly(height: f64) instead of jump(height: i32)?
minus-squareParanoiaComplex@lemmy.worldlinkfedilinkarrow-up10arrow-down1·edit-23 months agoI don’t know Rust but jump typically moves the program counter, where the height represents the number of instructions to move
minus-squaretrxxruraxvr@lemmy.worldlinkfedilinkarrow-up14·3 months agoAfaik 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.
minus-squareRustyNova@lemmy.worldlinkfedilinkarrow-up14·3 months agoThey created it. The compiler says the jump function is in src/main.rs
Height should be a float
But then wouldn’t it be
fly(height: f64)
instead ofjump(height: i32)
?Never use floats.
It’s height in centimeters
deleted by creator
I don’t know Rust but jump typically moves the program counter, where the height represents the number of instructions to move
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.
They created it. The compiler says the jump function is in src/main.rs
Chad quantised rust