Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 C++ Version of 2048
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
KitKat




PostPosted: Sat Dec 06, 2014 2:39 pm   Post subject: 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.
Sponsor
Sponsor
Sponsor
sponsor
Zren




PostPosted: Sat Dec 06, 2014 3:24 pm   Post subject: RE:C++ Version of 2048

Is this a console application? Or are you using a specific graphics library?
KitKat




PostPosted: Sun Dec 07, 2014 11:22 am   Post subject: RE:C++ Version of 2048

Console application.
KitKat




PostPosted: Sun Dec 07, 2014 11:28 am   Post subject: 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




PostPosted: Mon Dec 08, 2014 8:20 pm   Post subject: 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




PostPosted: Tue Dec 09, 2014 8:39 am   Post subject: RE:C++ Version of 2048

Okay, thankyou.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: