The short answer is No.
You should trick the hackers that couldn't hack your game.
For example, you add an extra condition for number 10, 10 is supposed to be maximum, if is more than number 10, the game restarts.
Another method, make multiple variables, variable 1 is for 10, and another variable 2 is for 10, they should compare as equal, the game works. Otherwise, variable 1 is different than variable, the game restarts. if you add extra variables such as 3, 4, A, B, it makes hard security. It's not perfect method, but if hacker gives up due to overtime.
Other thing, you might use PHP to get variables that they can't hack because it's server side.