Number connect 2d array c :  Number connect game,I am expecting the selected number to loop/move multiple times to connect another number.But I only manage to loop/move the number once,I am not sure why.I have attach an example below.I really need help.

Here's my code:   


    #include <stdio.h>
    #include <stdlib.h>
    
    
    char pname()
    {
      char name[20];
      
      printf("\n Please key in your name : ");
      scanf("%s",&name);
      printf("***Good day %s, let's start the game...all the best!!!***\n\n", name);
      printf("***Connect a pair of number[REMEMBER! Do not intersect the path]***\n\n");
    
    
    
    }
    
     
    /*gameboard function*/
    int gameboard(char box[9][9])
    {
         int x,y;
     /*Use for loop to Assign the inner element of the array*/ 
        for(x = 0; x < 9; x++)
        {
            for(y = 0; y  <9; y++)
            {
             box[x][y] ='_'; 
           
            }
    	}
       /*Use for loop to Assign the border of the array*/
    	for(x = 0; x < 9; x++)
        {
    
            box[0][x]='#';
    		box[x][8]='#';
    
            box[x][0]='#';
    		box[8][x]='#';
      
            
        }
    
    }
       
    /*Store the Random number in the game board*/ 
    void rnum(char box[9][9])
    {
     /*Declare variables as int type*/
     int r1,r2,r3,r4,x;
      /*Declare variables as char type*/
     char r='1';
    
            
       
     srand( (unsigned) time(NULL)); 
      /*generate random number between 1 and 7*/
     for(x=0;x<7;x++)
     {
     
      r1 = 1 + rand()%7;
      r2 = 1 + rand()%7;
      r3 = 1 + rand()%7;
      r4 = 1 + rand()%7;
       
      box[r1][r2]= r + x;
      box[r3][r4]= r + x;
     } 
    
     
    
    }
    
    
    void playgame(char box[9][9])
    {
      int x=0, y=0, choice2,a,b;
      char input,num;
     
    	 do{
         
         printf("Please select a number (1-7) : ");
    	 fflush(stdin);
    	 scanf("%c",&num);
    	
    	 if(num=='0' ||num > '7')
    	 {
    	 
    	 printf("Invalid!\n");
    	 printf("Please enter another number\n");
    	 
    	 }
    	 else
    	 {
    	 
    	 printf("\nNumer %i is currently selected!\n", num);
    	 
    	 }
    	}while(num=='0' ||num > '7');
    
    
    	printf("\n[1]Move\n[2]Sign out\n");
    	printf("\nEnter choice: \n");
    	scanf("%d", &choice2);
    
    
       
    	
    	for (a = 0; a < 9; a++)
    	{
    		for (b = 0; b < 9; b++)
    		{
    			if (box[a][b] == num)
    			   {
    			   
    			   x=a;
    			   y=b;
    			   } 
    				
    			   
    				
    		}
    	}
    
    	  
    	switch(choice2)
    	{
    	  case 1: 
        
    	       printf("Press 'e' to go up\n");
    			
               printf("Press 'd' to go right\n");
                   
               printf("Press 's' to go left\n");
                  
               printf("Press 'x' to go down\n");
               
    		   printf("Press 'q' to give up\n");         
           	   fflush(stdin);
    		   scanf("%c", &input);
    		   
    	
    		if (input == 'e')
    		{
    			box[x-1][y] = num;
    			x--;
    		}
    		else if (input == 'd')
    		{
    			box[x][y+1] = num;
    			y++;
    		}
    		else if (input == 's')
    		{
    			box[x][y-1] = num;
    			y--;
    		}
    		else if (input == 'x')
    		{
    			box[x+1][y] = num;
    			x++;
    		}
    		else if(input == 'q'){
    		
    	    printf("Thank you!");
    		
    		exit(0);
    		
    		}
    		
    
    				break;
     
            case 2: printf("Bye!\n");
        }
         
      
       
    }
     
     
    /*Main function*/ 
    int main(void)
    {
     
        /*Declare variables as char type*/
        char box[9][9];
    	 /*Declare variables as char type*/
        char name[20];
    	 /*Declare variables as int type*/
        int x,y,num,a;
         
    	system("COLOR E");
    	/*Display the Welcome greeting*/  
        printf("************* WELCOME TO NUMBER CONNECT ! ******************\n\n");
         
    	pname();
    	
    	/*call the gameboard() function*/
        
    	
    	gameboard(box);
    	/*call the rnum() function*/
        rnum(box);	   
    	/*Display the gameboard*/
        for(x = 0; x < 9; x++)
         {
          for(y = 0; y  < 9; y++)
            {
            printf(" %c ",box[x][y]);
           
             }
      
            printf("\n\n");
          }
         
    	/*Call the playgame() function*/  
    	
      for(a=0;a<9;a++)
      
    	{                
    playgame(box);    
    	for(x = 0; x < 9; x++)
         {
          for(y = 0; y  < 9; y++)
            {
            printf(" %c ",box[x][y]);
           
             }
      
            printf("\n\n");
          }
    	
      
        }
    	
        return 0;
    }

[Number][1]


  [1]: http://i.stack.imgur.com/Ng4Nt.jpg