If a cpu score is 20, and the players score is 5, the standard way to tell the difference and which score is higher is,
If cpu score is greater than players score, the 20-5 will give "15" the difference.
The same code applies to players score when it's higher.
Recently I coded with an app where you can't use maths to compare a score/value to another.
Like I couldn't code to have the cpu score minus the players score or vice versa.
I figured out a code/simple maths to compare the difference. Like if I always want the cpu to attack the player if the cpu score is 10 points or greater than the players score. I mentioned there's no way to use maths formulas to compare scores/values.
This solution can be used in Hopscotch.
Have 3 values.
Value A(player) Value B(cpu) Value C(difference)
When the player scores 1 point, have Value A go up by 1, Have value C go down by 1 point.
When the cpu scores 1 point, Have Value B go up 1 point, Have value C go up by 1 point.
When Value C is above 0, this shows how much higher the cpu score is above the players score.
When Value C is below 0, this shows how much less the cpu score is below the players score.