Random Numbers and Timers

Hey all

I wonder if you clever people can help, I am doing a short App Inventor course with TY students (Ireland) and have the idea for a fun app where they

Press a button and it gives them a 'coolness rating out of 100'
However OnClick I want this to cycle through (a loop) of 10 random numbers stoppign on the 10th one - this gives them their result !!

VERY simple, a Variable, a random number, a count and a delay (to give time to read it!)

But stone me this is giving me some trouble - I could write this in any manner of languages, but App Inventor is giving me grief, when I click my button I get one ONE number displayed, not the other 10 in the loop, as for the delay (simple enough ) i cant fathom it out.

As I say over you you clever people and thank you for your help in advance.

Cheers

Tim

As Eric Morecambe once said (paraphrasing)

"you have all the right blocks, but not necessarily in the right order"

image

set your clock interval as you wish

1 Like

TIMAI2 - you are the man (or the woman !!...apologies)

I loved Eric Morcombe, hey knew his code ;0)
Thank you I will try that

Fantastic name by the way
(from a fellow Tim)

Worked a DREAM thank you so much...

Here s a slightly different yet related point ... I nlw have 3 labels showing 3 values ALL on the count and across x2 clocks , the centre of the 3 is the 'cool reading' it looks and works ace , except the layout, i want the 3 labels spread across the screen, but they are all crushed to the left - i have used a horizontal arrangement, with 3 horizontal arrangements within (giving the look of 3 columns) - these are all aligned to center , yet on phone all is left of screen .

Any ideas are welcomed, but thank you so much already.

Tim

You shouldn't need the 3 horizontal arrangements....

Outer Horizontal Arrangement:
Align centre/centre
Width Fill Parent (or Width percent, e.g. 90)

Labels
Width Fill parent
Text Align centre

image

(You might want Screen1 Align centre if using width percent on the HA, or put the outer HA in a vertical arrangement and centre that, with width fill parent)
I have used colours to show the labels