Giving a flag for Array

Holla, i try to find out how to do this, maybe not actually giving a flag to array but i can’t think the proper name of my problems.

Basically i want to create an array to random textures
which is in my case will be a texture of “Math problems”… so the Textures must each contain with the answer, ex : a, b, c.

i create a GUI that have a button of A B C, so when the player press A it will check the value of texture is now a,b, or c… is that possible? i mean i know it’s possible but i couldn’t find out how… some pointer will be appreciated :slight_smile:
Thanks before

by ckecking the value of text do you mean in the array (in code) or on screen ? if on screen you can just set some border and in the code you can keep a separate bool array to mark which answer is selected (i.e. if you have array with Texture[ATex, BTex, CTex] then you have boolean[1,0,0] where 1 denotes checked) or even better you can have an array of some structs like :

struct Answer {
  Texture tex;
  bool isChecked;

and keep a list of those List instead of an array of textures. You can then use Linq to query this array like :

var selected = AnswersList.Where(l => l.isChecked);

which will return all selected.