Thread: noobie maze program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    53

    noobie maze program

    Im working on a maze solving program and i'm a little lost. It should just follow the maze walls to the right and find the exit using: west=0, north=1,east=2,south=3.

    The '.' represent open spaces in the maze, and the '#' represent walls.

    I have the maze and i have it printing but i am not sure how to do a solving function. I have searched but everything i found just confuses me and i cant figure out how to implement it in my program . Please help


    code
    Code:
    #include <stdio.h>
    #include <string.h>
    
     
     
    void display( char maze[12][12],int row, int column )
    {
    int i,j;
    for( i = 0; i<12; i++)
    {
    for( j = 0; j<12; j++)
    {
    printf( "%c", maze[i][j]);
    }
    printf("\n");
    }
    
    
    
    
    
    int main()
    {
    int row = 2;
    int column = 0;
    int direction; 
    char maze[12][12] = {'#','#','#','#','#','#','#','#','#','#','#','#',
    	             '#','.','.','.','#','.','.','.','.','.','.','#',
    	             'x','.','#','.','#','.','#','#','#','#','.','#',
    	             '#','#','#','.','#','.','.','.','.','#','.','#',
    	             '#','.','.','.','.','#','#','#','.','#','.','.',
    	             '#','#','#','#','.','#','.','#','.','#','.','#',
    	             '#','.','.','#','.','#','.','#','.','#','.','#',
    	             '#','#','.','#','.','#','.','#','.','#','.','#',
    	             '#','.','.','.','.','.','.','.','.','#','.','#',
    	             '#','#','#','#','#','#','.','#','#','#','.','#',
    	             '#','.','.','.','.','.','.','#','.','.','.','#',
    	             '#','#','#','#','#','#','#','#','#','#','#','#',};
    
    
     
    
    
    return 0;
    
          
    }
    Last edited by stormfront; 11-28-2005 at 02:52 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  2. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 10:58 PM
  3. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  4. my server program auto shut down
    By hanhao in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-13-2004, 10:49 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM