
-----------------------------------
KitKat
Sat Dec 06, 2014 2:39 pm

C++ Version of 2048
-----------------------------------
Hey guys. I'm completely a beginner in c++ programming and my task is to make my version of 2048 game in c++. 
I'm totally confused in the movement controls and don't know how to move elements of my array using keyboard keys. 
Please help.

-----------------------------------
Zren
Sat Dec 06, 2014 3:24 pm

RE:C++ Version of 2048
-----------------------------------
Is this a console application? Or are you using a specific graphics library?

-----------------------------------
KitKat
Sun Dec 07, 2014 11:22 am

RE:C++ Version of 2048
-----------------------------------
Console application.

-----------------------------------
KitKat
Sun Dec 07, 2014 11:28 am

RE:C++ Version of 2048
-----------------------------------
I've read about the switch statement but I guess it involves the use of breaks which I'm not allowed by my instructor.

-----------------------------------
Insectoid
Mon Dec 08, 2014 8:20 pm

RE:C++ Version of 2048
-----------------------------------
Are you allowed to have the user hit 'enter' after entering a command or does it have to happen instantly?

you could just scanf a char, check if it's a movement char, then iterate over the array, checking if each element can move in that direction based on the rules of the game. 

You will have to change which order you check the indices in depending on the direction of the shift.

-----------------------------------
KitKat
Tue Dec 09, 2014 8:39 am

RE:C++ Version of 2048
-----------------------------------
Okay, thankyou.
