My first App

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.

Thanks forward <3
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)

just my 2c though.
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.
so, if I understand correctly you want to make an array?

 
int RubixCube[3][3][6]; // row/column/side 


where RubixCube[1][0][0] would be the first square on the first row in the first column on the 'top' side.

that's what I would do anyways, and you can set the give each one an int value for what colour they are.

here is a quick bit of code to show it in the console:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>

using namespace 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();
}
deepest thanks to u
using namespace 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.

Also, welcome to the forum!
Last edited on
Hi #mbozzi yeah but alweys use using namesace std; so i think it will not big problem
-mbozzi:
My apologies, in the future I'll leave it out when giving examples here.

-Dagr
Glad I could help :)
Topic archived. No new replies allowed.