What's my error in it?
Code:
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <stdlib.h>
#define rows 9
#define columns 9
void GetUsername(char username[]);
void Function(int myArray[rows][columns]);
char Move(myArray[rows][columns]);
int main()
{
char username[30]; /* u nid to have this here */
int myArray[rows][columns]; /* u nid to have this here */
printf("\n################WELCOME###############\n");
printf("\n################NUMBER CRUSH##################\n");
printf("\n");
GetUsername(username); /* pass username to function */
Function(myArray);
Move(myArray); /* pass myArray to function */
return 0;
}
void GetUsername(char username[30]) /*after u pass username the function ACCEPTS
username */
{
printf("Please enter your username to login\n");
printf("\n");
printf("\nUsername:");
scanf("%s", username); /* for array, dont need to use &username for scanf */
printf("\n");
printf("Good day, %s and best of luck in crushing the numbers", username);
printf("\n\n");
}
void Function(int myArray[rows][columns])
{
int x,y;
int steps;
int n;
srand(time(NULL));
for(x=0; x<rows; x++)
{
printf("\n");
for(y=0; y<columns; y++)
{
n=rand()%9+1;
printf("%6i\t", n);
/*if(myArray[rows][columns-1] || myArray[rows-1][columns])
continue;
else
break;*/
}
printf("\n\n");
}
if(steps>0)
printf("\n%i Step taken", steps);
printf("\n\n");
printf("Press 2 - Down\n");
printf("Press 4 - Left\n");
printf("Press 6 - Right\n");
printf("Press 8 - Up\n");
printf("Press Q to give up\n");
}
char move(myArray[rows][columns])
{
char move;
do
{
fflush(stdin);
move = getche();
if(move == '2')
down(myArray); /*execute down function*/
if(move == '4')
left(myArray); /*execute left function*/
if(move == '6')
right(myArray); /*execute right function*/
if(move == '8')
up(myArray); /*execute up function*/
if(move == 'q')
quit(); /*execute quit in game function*/
if(move == 'Q')
quit(); /*execute quit in game function*/
}while(move != '2' && move != '4' && move != '6' && move != '8');
}