1. ## slider game

i have to create a slider game i have made the part where you create non-repeating numbers each time you run the game:

Code:
```#include <stdio.h>
#include<time.h>

int check(int num, int array[4][4]) {
int i, j;

for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
if (array[i][j] == num) {
return 1;
}
}
}

return 2;
}

int main (){
int x,y,arr[4][4];
int w;
int ok=0;
srand(time(NULL));

for (x=0;x<4;x++)
{
for(y=0;y<4;y++)
{
if (x ==3 && y ==3) {

printf("| \t");
}
else {
ok =1;
while (ok!=2) {
w = rand()%15+1;
ok = check(w, arr);
}
arr[x][y] = w;
printf("|   %i\t",arr[x][y]);
}

}
printf("|\n");
}```
i have to now assigne keys to move the numbers about
can sum help me in doing this.

2. I remember a scifi show by that name, but not a game. What is the object of the game?

3. you have to arrange the numbers in ascending order by moving the numbers around.

i basically want to achieve this:
How to do a sliding puzzle - YouTube

i want to know how to assign keys to move the numbers up,down,left right.

I remember a scifi show by that name, but not a game. What is the object of the game?
Fifteen puzzle - Wikipedia, the free encyclopedia

Not really suited to console mode... but I guess an interesting challenge anyway.

5. I liked using getche() from conio.h, to get the keys, and had a menu like this:

Code:
```  do {
gotoxy(54,12);
printf("                       ");
gotoxy(5,12);
printf("Moves are: up, down, left, or right (q to quit) [u/d/l/r/q]: ");
//scanf(" %c", &ch);
ch = getche();
//    r = getchar();
switch (ch) {
case 'u': up(); break;
case 'd': down(); break;
case 'l': left(); break;
case 'r': right(); break;
case 'q': return;
default:
gotoxy(5,12);
printf("That's not a move, please try again                             ");
sleep(1);
}
printGrid();
}while(!isDone());```
Other alternatives are to use getchar() or even scanf() (but remember to add the getchar() after them to remove the trailing newline from the keyboard buffer).