I'm making a random group generator but I don't know how to create it in block code. I also need a saving feature where it will automatically save all the information that the client adds into a data source for later use.
What is a random group generator
?
It is an app that receives a list of student's names and generates randomly selected groups based on the number that the client selects. By inserting the list of names into the team generator, the team generator will randomize all the names you entered into equal groups. The number of people per group should be chosen by the client
an example will be better for us to understand.
Looks like a lot of list operation needed.
I haven't figured out a code to divide the list into groups but here is the basic outline for adding the names in a list. Also, this isn't a code but an example of an online
Are you working on Thunkable?
or Niotron ?
If so, why are you asking on this community ?
I used thunkable to make the basic outline however I need to alter the code to fit the blocks in MIT App Inventor
Thunkable and MIT AI are totally different now, how can you altr one to another?
And I am still not how to generate random team. any sample?
The general algorithm for dividing up a list of people into n random teams:
- make a temporary copy of the list of people, called ReserveList
- make n empty lists, one per team, as items of a list TeamList
- while ReserveList is not empty
- for each i from 1 to n
- if ReserveList is not empty then
- set local k to random integer between 1 and length of list(ReserveList)
- add to TeamList(i) item=ReserveList(k)
- remove item k from ReserveList
- end if
- end for each i
- end while
Or use the new introduced block :
1 Make new Sorted List .for shuffle list
2 Slice List for separate big list to small lists.