![]() |
|
#1
|
|||
|
|||
2D array programVery often in fairs we come across a puzzle which contains numbered square pieces, which can be
moved horizontally or vertically. A possible arrangement of these pieces is shown below (Hint: This is a 2D integer array!): 1 4 15 7 8 10 2 11 14 3 6 13 12 9 5 ☺ As you can see there is a ☺ at bottom right corner. Implement the program so that a box like the above one is displayed (lines may not be displayed). Allow the user to hit any of the arrow keys (up, down, left, or right). If user hits say, right arrow key then program should give a message that this movement is not possible. If user hits left arrow key then 5 should move in place of ☺ and ☺ should move in place of 5, and box will look like: 1 4 15 7 8 10 2 11 14 3 6 13 12 9 ☺ 5 Similarly, you can experience with all arrow keys and movements of ☺ will take place, if possible. The user would continue hitting the arrow keys till the numbers aren’t sorted in ascending order. please help me getting solve this problem. |
|||
|
#2
|
|||
|
|||
Re: 2d array programHere is a start:
CPP / C++ / C Code:
CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: 2d array programthanks buddy.
|
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Equation solver | RazoR | C Programming Language | 3 | 18-May-2008 10:24 |
| Returning a 2 dimensional Array from a function | vicky_brsh | C++ Forum | 1 | 04-Jan-2008 15:06 |
| Need Help with input files. | Efferus | C++ Forum | 2 | 24-Nov-2007 17:19 |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 11:13 |
| Need help deleting the last element in the array | headphone69 | C++ Forum | 2 | 15-Mar-2006 20:31 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The