If I have certain instructions in separate classes, how would I bring them up randomly?
For e.g., if one class plays an audio file and another class adds two numbers, I want to be able to randomize to bring up a random number or label that corresponds to each class.
What is the syntax I need to use to carry out the aforementioned in C#?
I’d use a List, where ISomeAudioPlayer defines a
Playmethod. Use theRandomclass to generate a number between 0 and the number of different possibilities, then call your Play method on the object at that index in your list.