# Creating a record of values generated with Random.Range

First I want to say thanks to al the people who answer these questions. I just made my first working game which is a Rubiks Cube. There’s more to do to make it officially “complete”, but it works. It’s really hard to break, it shuffles itself on command and it’s actually kind of fun. There is no way I would have made it this far without the information I learned in these Answers. Ironically, this is my first time asking a question. So here it is…

In order to randomly shuffle the cube, I replace user input control with the following code that accounts for all 18 possible 90 degree rotations that can be made on a given move. Can randomly generated values be stored such as in a list or some time of data collection? If it is possible to store these 18 outcomes, could someone please recommend the datatype(s) to consider and point me in the right direction as far as capturing this data as it happens in realtime. Thanks!

``````	void GenerateAxisA()
// Generates values for aAxis(rotation axis)
// and aPos(face to rotate)
// Keeps generating random rotations until shuffleCount = 0
{
{
int a=Random.Range(1,7);

int p=Random.Range(-1,2);
if(a==1)
{
aAxis=new Vector3(1f,0f,0f);
aPos = new Vector3((float)p,0f,0f);
_xRoto=true;
_yRoto=false;
_zRoto=false;
}
if(a==2)
{
aAxis=new Vector3(-1f,0f,0f);
aPos = new Vector3((float)p,0f,0f);
_xRoto=true;
_yRoto=false;
_zRoto=false;
}
if(a==3)
{
aAxis =new Vector3(0f,1f,0f);
aPos = new Vector3(0f,(float)p,0f);
_yRoto=true;
_xRoto=false;
_zRoto=false;
}
if(a==4)
{
aAxis =new Vector3(0f,-1f,0f);
aPos = new Vector3(0f,(float)p,0f);
_yRoto=true;
_xRoto=false;
_zRoto=false;
}
if(a==5)
{
aAxis =new Vector3(0f,0f,1f);
aPos = new Vector3(0f,0f,(float)p);
_zRoto=true;
_yRoto=false;
_xRoto=false;
}
if(a==6)
{
aAxis =new Vector3(0f,0f,-1f);
aPos = new Vector3(0f,0f,(float)p);
_zRoto=true;
_yRoto=false;
_xRoto=false;
}
shuffleCount-=1;
_axisGenerated=true;
}
}
``````

You can use a generic List (System.Collections.Generic) with a “struct” representing your transformations (“a” and “p”, it seems).