I'm making a small game, and to implement the points I'm thinking of initializing it like this: 00000, each enemy that I eliminate adds value, but it would start from back to front, that is, I eliminate an enemy that gives 5 pts, it would be 00005, I eliminate another, 00010, that is to say that it is added to the back digits, I do not put a code because I really have no idea how to start it.
You could concatenate the values after performing the sum of points and return your points with the four digits in string format. Something if :
Although Santiago's answer works, I leave here my way of doing it which is cleaner than using "if-else" which is itself a bad practice.