Hi guys im going to make my firs app and i need help.
Its about Rubik's cube, we must convey the position of cube and after this app must tell us the correct way to bild cube.
Firs of all we must describe 27 small cube seperetly, What i want to do is to describe this cubes but I need some push like firs steps help me to describe only 1 side of cube by class and it will be enough for me.
I'm new to this forum, so my apologies if I mis-understood something.
to do this in C++ is very difficult, you first must learn DirectX (or similar) which is a big task in of itself, then you need to make a game engine, and THEN you can start building the game, at which point you will be good enough you probably won't need to be posting here.
I recommend using something like Unity, which is a pre-made game engine with a easy user interface and will make this game easier (though still not easy since rubic cubes are fairly complex)
Firs of all thank you for reply. I dont wotn to make a game and also I dont want this in 3D i mean in cmd we must get only movies for get correct way and its enought, Its only for for consol. I want only firs step how to describe part of cube seperetly.
#include <iostream>
usingnamespace std; // makes it easier so you don't have to type std:: every time
void main()
{
int RubixCube[3][3][9];
// 1 = red
// 2 = blue
// 3 = yellow
// 4 = white
//lets make the 'top' side all white:
int CurrentSide = 0; // this is the side we shall colour
int ChosenColour = 4; // make them white
for (int Y = 0; Y < 3; Y++)
{
for (int X = 0; X < 3; X++)
{
RubixCube[X][Y][CurrentSide] = ChosenColour;
}
}
// you can do this loop for all sides.
// Lets show this side in the console:
for (int Y = 0; Y < 3; Y++)
{
for (int X = 0; X < 3; X++)
{
// output the number it contains to the console
cout << RubixCube[X][Y][CurrentSide] << " ";
}
// at the end of every row we go down the next line:
cout << endl;
}
//pause the program so we can see what has happend (hit any key to continue)
cin.get();
}
usingnamespace std; // makes it easier so you don't have to type std:: every time
Perhaps it saves keystrokes, but it also makes your code worse by potentially introducing silent changes to your program's behavior at the whim of the second or third party.
Not good stuff. Ideally, only you should have control over the semantics of your code.
Do not import namespaces. If you need Koenig lookup, import individual names, not the whole namespace.