mardi 28 janvier 2020

Is there a way to run functions in the order of a randomly generated list in Arduino IDE?

I have a list of functions like this for instance:

void cube () {...}
void diamond () {...}
void cylinder () {...}
void sphere () {...}
void cone () {...}

and I make a random function where it generates a list of non-repeating numbers (let's say between 0 and 4) so that it creates a list like this:

random_List = {1,0,4,2,3}

I already know how to make the list, but after that, what would I have to do in order to make the functions run according to the sequence of the list? I will assign a number to the functions like void cube () {}would be assigned 1 and void diamond () {} would be 2 and so forth.




Aucun commentaire:

Enregistrer un commentaire