25Granger wrote:
The while loop is seperate from the ascent loop but you got that right with how ascent works.
I think that we could ignore the while loop in its entirety actually, as the ascent loop has no condition regarding x, it just runs untill i=23 starting with i=6 and incrementing i by one with each loop. I think.
The first while loop just basically does x = 10;
The "ascend" thing saves 23 / 2 (11,5) as the last value to x.
thus, x == (23/2) returns true, and the value of x is 25.
SPOILER
tested with similar c++ thingy
#include <iostream>
int main() {
int x = 5;
while (x < 10) {
x++;
}
for (int i = 6; i <= 23; i++) {
x = i / 2;
}
if (x == (23 / 2)) {
x = 25;
}
else {
x = 23;
}
std::cout << x << std::endl;
system("pause");
return 0;
}