this post was submitted on 21 Dec 2024
76 points (94.2% liked)

Fun Loops ▶️

438 readers
832 users here now

Posting interesting/cool/funny videos from Loops here

https://loops.video/

Thanks to @Bluefruit @lemmy.world for the icon and banner!

Discussion of and questions about Loops should go over in [email protected]

If the loop you're posting isn't original content uploaded by the creator, prefix the title with [R] for "reposted". For example, [R] Cute dog.

If you know the source for a loop marked [R], please comment with it!

Rules:

  1. Don't be a dick
  2. Don't make me add more rules

founded 2 months ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] -3 points 1 month ago (11 children)

I'm sorry, but even without knowing about the mod operator, this is inefficient and over engineered. Why have a loop at all?

fun isEven(n: Int){
    return n == abs(n)
}

no loop required...

having said that, I can totally see how that was missed in a high pressure interview. I hate interviews like that!

edit: Ha ha... isEven...not isPositive... I'm tired. ignore me!

[–] braindamagebuddy 9 points 1 month ago (1 children)

Lol I think the interview pressure got to you.

[–] [email protected] 6 points 1 month ago

Ha ha ha, yup... whoops!

load more comments (9 replies)