393
Rule (lemmy.blahaj.zone)
submitted 3 weeks ago by Persona3Reload to c/196
you are viewing a single comment's thread
view the rest of the comments
[-] Euphoma@lemmy.ml 81 points 3 weeks ago

return true

is correct around half of the time

[-] ImplyingImplications@lemmy.ca 41 points 3 weeks ago
assert IsEven(2) == True
assert IsEven(4) == True
assert IsEven(6) == True

All checks pass. LGTM

[-] aliser@lemmy.world 18 points 3 weeks ago
return Math.random() > 0.5

would also be correct about half the time

[-] deo@lemmy.dbzer0.com 2 points 3 weeks ago

Wouldn't that only be correct about 25% of the time?

[-] rain_worl@lemmy.world 0 points 2 weeks ago

for even, 50% chance of correctness, same for odd.

this post was submitted on 31 Oct 2024
393 points (100.0% liked)

196

16563 readers
1565 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS