I posted here the other day and got a good answer. I’ve been working on the code and I have a new challenge. I created a simple program that chooses a random item from a list. I figured out how to make it dynamic using checkboxes. I have 10 groups of data that I created using list<string>. If box A is checked the button chooses a random item from group A. If box A,B,C are checked it chooses a random one from from all three groups. I did this by writing them to a hidden listview box and return a random item from the list then clearing the list.
Anyway, what I need to do now is add another set of checkboxes that will add/remove monsters from the different groups. For context the items are types of monsters for a board game. But most people don’t have all the different monsters. So I want to be able to have them select which expansions they have then that will add/remove that monster from the appropriate list when choosing a random monster.
The only solution I see as a novice is to use a bunch of if statements in front of the .Add. For example,
If (checkboxA.checked) {monster.Add.(“Dragon”);}
Is this the best way? Any advice is appreciated. Thanks.
Anyway, what I need to do now is add another set of checkboxes that will add/remove monsters from the different groups. For context the items are types of monsters for a board game. But most people don’t have all the different monsters. So I want to be able to have them select which expansions they have then that will add/remove that monster from the appropriate list when choosing a random monster.
The only solution I see as a novice is to use a bunch of if statements in front of the .Add. For example,
If (checkboxA.checked) {monster.Add.(“Dragon”);}
Is this the best way? Any advice is appreciated. Thanks.
Last edited: