SUP people. I'm doing random number generator but it is like lottery. With one press on the button i generate 7 diffrent numbers. My problem is how to make them that there are diffrent number and there cant be any numbers that are the same. Thanks for responds! <3!
Hello @urbanamon. Welcome to the MIT AI2 Community!
Perhaps the following code might help you:
The "join" block can be found in the text column, while the "random integer" block is in the Math one.
@nishyanthkumar You need to handle the fact that your blocks do not guarantee 7 different/unique numbers....
Also, using the join block as you do creates one long number, not 7 numbers.
Closer, but still not correct.
Try something like this:
oops - see below
You may want to sort the numbers in the list after they have been generated.
This solution would leave you short of 7 numbers if you got any duplicates.
There are two solutions at
That is my designer... I hope u can understand my language. I'm from Slovenia but i think if u do this often u dont need translate... Text for label its just title...but just in case u need translate:
število=number
prvo=first
drugo= second,.....
generiraj števila=generate numbers
where can i find call (puprple) block?
Get current millis using Clock component.
Somehow get last 7 digits.
I cant find call ListAddon1. bubbleSort list....i have only three purple blocks
Hmm, for what purpose? How should that help?
To generate a random 7 digit unique number.
However, digits will not be unique, always.