4 ms·
I got `2, 1, 0,` I read the instruction as: "Set i to 3. Subtract 1 then print until false." i = 3 3 - 1 = 2, print 2 - 1 = 1, print 1 - 1 = 0
by Nadya 10y ago
I got `2, 1, 0,`
I read the instruction as: "Set i to 3. Subtract 1 then print until false."
i = 3
3 - 1 = 2, print
2 - 1 = 1, print
1 - 1 = 0, print
0 = false, stop
I see a lot of people complain about using `--` like that but I fail to see what is unintuitive about it if you actually read the code and see what i is initialized as. =\
- kstrauser 10y agoUgh, never mind. I was misinterpreting that the shell was saying. See? Told you I'm dumb.