Game Predictor adding up score problem

Please could you reply before Tuesday the 13th of July

Hello again everyone I have another problem with my Euros score predictor game. It is not complete yet but on the results page it adds up your score for how many points you have gained and how close you were to the actual score. For some reason every time you go on the results page it says the points this round is 10 no matter what your actual score is. Thank you everyone for your help!

Link to the app: Thunkable

1 Like

It’s always a good idea, especially if you are hoping for swift help, to indicate where in a complex app you think the issue is. I’m guessing the code you refer to is this:

Apparently, none of the if or else if conditions is being met.

I see you set the Team Real scores here:


That’s a list. It may be a list with one item in it, but it’s a list.

Meanwhile, you set the predictions here:
image

Which means those predictions are text.

I suspect you’re getting 10 points each time because even though to your eyes they’re both numbers, to Thunkable, neither one is a number. To fix:
Use a math block to add 0 to the predicted scores (making them numbers)
Get the first item from the list (use the blue list block) to convert your list of real scores into a text string, then add 0 to it.
That may be overkill - you might just need to convert the list to text to get it to work - you’ll have to try it out.

As an aside: Stored variables are slower to use than app variables. You might want to start by setting an app variable to the value of the stored variable and then do your manipulations and comparisons on the app variable. I think you’ll find your app runs faster.

Second aside: You know that stored variables are only on the local device, right? So will multiple users use the same phone to make predictions? Or how will this work?

4 Likes