Can any of you clever folk make this code shorter?
It's bugging the life out of me but I don't know how to make it shorter though it looks like it can be.
--p.c= n / 2 + 0.5 ? if (p.t/p.die<7/#p.c_table) p.c=4 if (p.t/p.die<5/#p.c_table) p.c=3 if (p.t/p.die<3/#p.c_table) p.c=2 if (p.t/p.die<1/#p.c_table) p.c=1
No worries, happy to help.
I don't know exactly what this code is doing or why it's doing it but you should be aware though that my version is potentially brittle if any of the numbers in your code need to change. Like, in the first line of your original code if you want that to be p.c = 5 for some reason my version won't work anymore.
[Please log in to post a comment]