Alright ive been busy on a text based game and i got stuck again i want my zombies to have 5 attack but with 2 zombies 10 i know how to do this but a zombies health is 10 all i need to do is if the health is 39 it should make it 3 zombies or 72 6 zombies and so on i really dont know how to do this is there any equation to do this or any code thank you
since it is fixed but still a little huge if i want to go to higher numbers like 100 is there any way u can simplify this code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
if ( z > 0 || z < 11)
y = 1;
}
elseif ( z > 11 || z < 21)
{
y = 2;
}
elseif ( z > 21 || z < 31)
y = 3;
}
elseif ( z > 31 || z < 41)
{
y = 4;
}
elseif ( z > 41 || z < 51)
y = 5;
}
Dam thats a nice way but it messes out becuase when i want 19 to be 2 it end up being 3 becuase its 2.7 but for larger numbers it works great thanks man really nice