Human Resource Machine

Human Resource Machine

View Stats:
Kiahnte Apr 30, 2024 @ 9:10pm
Year 14 - Negative Numbers?
Hey,

I'm stumped on year 14. Obviously, my initial thought it to subtract the 1st number from the second, if it's negative, then outbox the first, otherwise outbox the second. The solutions I found online basically do this too.

But that doesn't account for negative numbers. If I subtract a negative number from a positive, the output will always be positive, but won't tell my program whether or not that's what happened. There are other issues too depending on the combination, but none of the solutions I've seen seem to account for negative numbers (unless I'm missing something). Can you help?
< >
Showing 1-2 of 2 comments
IJIyusha May 1, 2024 @ 9:45am 
Looks like bug maybe. Becouse i recogniced the same case.
And looks like weird that if functionality work incorrect. If i write
if(number == 0){
}
section will not execute.
It will wors like
if(number !=0){}
Unknown May 15, 2024 @ 2:13pm 
If you subtract negative number from positive number, output will be positive number. So your first statement is still correct: "if it's negative, then outbox the first, otherwise outbox the second."

In this case you will output second number which was positive, which was higher. First number was lower.
Last edited by Unknown; May 15, 2024 @ 2:13pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50