389
Rule (lemmy.blahaj.zone)
you are viewing a single comment's thread
view the rest of the comments
[-] Euphoma@lemmy.ml 83 points 5 months ago

return true

is correct around half of the time

[-] ImplyingImplications@lemmy.ca 42 points 5 months ago
assert IsEven(2) == True
assert IsEven(4) == True
assert IsEven(6) == True

All checks pass. LGTM

[-] aliser@lemmy.world 19 points 5 months ago
return Math.random() > 0.5

would also be correct about half the time

[-] deo@lemmy.dbzer0.com 1 points 5 months ago

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

[-] rain_worl@lemmy.world 0 points 5 months ago

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

this post was submitted on 31 Oct 2024
389 points (98.3% liked)

196

17487 readers
1252 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 2 years ago
MODERATORS