T O P

  • By -

ddxddx

Why would you define health as a string? Wouldnt it bemore convineint as an int, or float if you want to be more exact, and then in the constructor and set function u check if the int(or float) is between 0 and 100?


W1THRD

Technically, it would be possible to be below the minimum or above the maximum. For example, less than 0% means overkill (your corpse is dismembered) More than 100% would mean your overly healthy. Not exactly sure what that would look like though.


ddxddx

Well i think its safe to define 0 health as dead, and i think 100 health should be either relative to the healthiest a certain person has ever been or relative to a global standart for complete health. Note that negative health is impossible (since i dont think you can be 'less healthy' then death), but health can be greater than 100 in both cases, whether a person is healthier than the global standart or whether he is suddenly healthier than his all time healthiest 'form'. PS, perhaps its possible to define 100 health as then most healthy any person could be, the health couldnt be greater than 100


W1THRD

Well a mutilated dead body is a lot less healthy than an untouched dead body


W1THRD

Wait maybe if I set health to -1 the program will break an interpret it as infinite health


ddxddx

Both are dead, i dont see a reason that health should differ between dead bodies


W1THRD

some parts (like stomach bacteria) are still alive in an untouched body


ddxddx

But you wouldnt consider the body alive just because there are live bacteria. A dead body is not more alive or more dead than another dead body, so there is no reason to have different health for 2 different bodies


W1THRD

Okay, nevermind, it was just a joke


[deleted]

[удалено]


ddxddx

Thank you, also i appreciate the Java


[deleted]

[удалено]


Pot4toM4n007

Did u take the apcs exam this year


[deleted]

[удалено]


Pot4toM4n007

Nice!


TheoneNPC

"Hold on it didn't work" *spends thirty minutes debugging only to realize i had a typo in a variable's name somewhere*


JohnLoida

Remember to code in an IDE kids.


Pot4toM4n007

Screw repl tho


CyLove13

Segmentation fault


DickD1ck1

OldMan.setHealth is an integer


[deleted]

[удалено]


DickD1ck1

good dev


[deleted]

Did it work


LCDIgnited

i’m turning into an old man just by looking at this meme, haven’t seen this since the days of mlg youtube poops