iwrite4myself t1_ittjw67 wrote
Reply to comment by AutoModerator in [WP] You are an NPC in an RPG. Normally, your attack is set to 1. However, a player used a cursed item on you, reducing your attack by 2, causing it to underflow, making you the most powerful in the game. by alegonz
I must be missing something. Can someone please explain this prompt like I’m five?
1-2= -1
Would this not simply heal the opponent by one point? How is that the most powerful in the game?
Unless this is some kind of hardcore game where no one can ever heal and players now have a slow-but-reliable healer?
Traps-big-gay t1_ittpg2e wrote
If your code uses unsigned integers it can't handle negatives, so it loops back to the highest positive value
iwrite4myself t1_itu0ejw wrote
Ah. Thank you!
JudgeHodorMD t1_ittymwf wrote
This is about data types in programming. The code only has so many digits to work with. So there’s only so many possible numbers.
Like 0 to 9999, except it’s more like a binary equivalent. No numbers exist that are outside of that range. If you try to go past the limit you can get an error where it basically just loops around.
Viewing a single comment thread. View all comments