21
you are viewing a single comment's thread
view the rest of the comments
[-] amateurcrastinator@lemmy.world 1 points 4 months ago

I am not a coder. How does that equal to 1? That for to me reads x in 3 to 5 in steps of 3 so that will only take 3 and that's it. That means it will be on the else branch of the if and since result is 0 initially then it becomes 3. For exits and that is that. What am I missing?

[-] anomnom@sh.itjust.works 5 points 4 months ago

The for loop is stepping through an array: 3,3,5

So it’s really just 3+3-5=1

I’ve never used a for look that way though, but if the array object supports it in that language then it should work.

this post was submitted on 17 Dec 2025
21 points (95.7% liked)

Hacker News

4808 readers
403 users here now

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

Source of the RSS Bot

founded 2 years ago
MODERATORS