i am creating app which take form local Db the Row randomly
the the row can be repeated many times Because The random Number is repeatd i want to choose the same nuber Just one Time
i am creating app which take form local Db the Row randomly
the the row can be repeated many times Because The random Number is repeatd i want to choose the same nuber Just one Time
Hi, @3bdoamir1!
Welcome to our community!
For this, you would need to store the used numbers in a list, and everytime generating a new random no., only accept it if itās not in the used numbers list.
First try applying this method yourselves, and tell us the result. If you stuck, weāll help you out
Good Luck!
Thanks!
To piggyback off @kartik14, I would get a super long list Of integers from random.org
cqn You describe more about your app? Iām not sure I understand what you are trying to do after rereading everything. Do you want the row from localDB to be deleted? Or just not used until all rows have been used at least once?
If thatās the case there is a special block just for that.
In my quiz app, I take all of the questions from local dB, put them into an āappā type variable I call tempList. Then as my quiz steps through each question, instead of getting it from the localDB, I pull the question from var āapp tempListā. I use the blue list block that says āget and remove #ā. Then the app ends when āapp tempList is empty.
The next time the user want to take that quiz to study, all or the questions are reloaded into āapp tempListā and the process starts over again
I just to make a random number say from 1 to 100 not repeated every btn click like 18 btn click the variable becom 16 >>> btn click the variable become 98 btn click the variable become 15
i want the variable change every click not( 18 >16>> then 18 again)
Does that happen when you use the random integer block?
The thing about randomness is that your odds that you will get the same number two times in a row are just as likely as getting a different number. are just as likely to get the same number as any other number.
I Know its Just example >> what i want make the variable a number and never repeat again when i click btn i want like that it i press btn the variable change every click like random number from 1 to 10 (1.4.8.6.5.3.2.,10,9,7) no repeat numbers every btn change avariable to new number
that what i want to do but i cant can u help me pls
My browser crush when i try it
the link
https://x.thunkable.com/copy/d3168f449d89b1426a6302d4084d7222
Hi, @3bdoamir1!
Very sorry to inform, I had mistake in my code
Please try this one, this works brilliantly for me -
Apologies
Thanks!
This task has been solved more than once on the forum.
Repeat steps 2-5 if the list is not empty
i want to make iq test 200
thats really what i want but try it with 5 numbers rather than 100
u will find the number repeat
sorry i am new >> i want to do iq test 30 qustion from 200(after 30 its end ) every time you answer its replace questions and answers all done >> now when i make it choose questions randomly it may repeat some qeustions i want to make a variable with every btn click it change to new value (not repeat any old ) can u help me with blocks to make random variable every click no repeat
Search the forum. This has been solved before.
I found extension . aia i cant use them or a written and i am new so i cant do it co u help me
All you need to do is create a list with the numbers 1-100 (or however many records you have).
Select a number at random from it and remove it from the list.
This way every number will be unique.
Check it