hey, im trying to write a code that generates a maze....i have everything right so far, but now need to get the maze to print out. i know i need to use a loop but im having trouble figuring out what kind and what to write. my computer crashed so i had to rewrite this program and im not very good at this....my brain is fried. please help!
Code:
#include <stdio.h>
//#include "maze_gen.c"
#include <stdlib.h>
#include <math.h>
int main (void)
{
char myMaze [700]; //big enough to handle a 625 char array
int user_n = 0;
int i = 0;
//while loops so that the user can keep tryin to enter a valid nubmer
while(i == 0)
{
//ask the user what value of n for the maze they would liek to use
printf("What value of n would you like to use-->");
scanf("%d", &user_n);
//make sure the user entered a valid number for n, greater than five and also odd
if(user_n < 5)
{
printf("Not a valid number, please try again\n\n");
}
else if((user_n%2) == 0)
{
printf("Not a valid number, please try again\n\n");
}
else if(user_n > 25)
{
printf("Not a valid number, please try again\n\n");
}
if(((user_n%2) != 0) && (user_n >= 5) && (user_n <= 25))
{
i = 1;
//printf("right entry"); check to make sure it worked properly
}
}
//create the maze using the function call maze_create(), passing in the user_n and the array myMaze
maze_create(myMaze, user_n);
system("PAUSE");
return 0;
}