81
submitted 6 months ago by m_f@midwest.social to c/loops@midwest.social
you are viewing a single comment's thread
view the rest of the comments
[-] Kraiden@kbin.earth 5 points 6 months ago

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!

[-] petrol_sniff_king 8 points 6 months ago

I'm not following.
n == abs(n) only tells you if it's positive.

[-] Kraiden@kbin.earth 6 points 6 months ago

yes, I'm being a dumb tonight. I'm completely wrong

[-] petrol_sniff_king 4 points 6 months ago

Haha, s'all good, yo.

load more comments (7 replies)
this post was submitted on 21 Dec 2024
81 points (100.0% liked)

Fun Loops ▶️

978 readers
1 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 !loops@lemmy.world

If the loop you're posting isn't original content uploaded by the creator, prefix the title with ♻️ or [R] (if you don't feel like typing an emoji) for "reposted". For example, ♻️ Cute dog or [R] Cute dog.

Note that some loopers upload their loops to multiple platforms including Loops, so you might see insta/tiktok logos on videos that aren't marked as reposts.

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 7 months ago
MODERATORS