Hello, I'm currently making a game, called rubik cube, however, this is more a syntax question than it is about the game properly.
I have defined the following structure, and can«t find out how to initialize the whole structure.
Code:
// each square of the little cubes in the rubik cube
typedefstruct quadr
{
char collor;
char axys;
} quad;
// Cubes in the rubik cube
typedefstruct squareR
{
quad q[6];
char axys;
// Check if its side is valid, eg. If it shows on the rubik cube
int valid;
} square;
// Rubik cube
typedefstruct cubeR
{
square q[3][3][3];
} cube;
I was thinking of doing something like this:
Code:
void startup()
{
int x,y,z,w;
for(x=0;x<3;x++)
{
for(y=0;y<3;y++)
{
for(z=0;z<3;z++)
{
for(w=0;w<6;w++)
{
//initialization goes here
}
}
}
}
}
The hard part i find by now, is making the initialization...
The axys variable has to do to which side the cube(s) are turning to, so that i can show the correct collors.
The collors at the beggining, will be filled probably with numbers from 0 to 5, or something like that.
I would also appreciate some feedback on the way I'm trying to make the game, and know if I'm proceeding correctly.
Thank you,