Thursday, December 26, 2019

How to make Maze in 2d using C programming language using concept of Data structure and Algorithm

MAZE Generator




ALGORITHM


  1.  Start
  2. Declaration of all the necessary variable.
  3. Display initial message to user to perform some task.
  4. Depending upon the user input perform task as below:

a)    if userInput == 1 then draw maze.
                                                                             i.          Take length and width of maze from user.
                                                                           ii.          Allocate memory segment for all maze dynamically.
                                                                         iii.          Set boundary  with “#” character.
                                                                         iv.           Link inner node with each other.
                                                                           v.          Check whether destination is wall or not.if not make it blank.
                                                                         vi.          Draw character of each node to generate maze.
b)    else if userInput == 2 then terminate  the program.
c)     else goto step 3.


  1.  Handle  all necessary exception.
  2.   stop.



      CODE




























No comments:

Post a Comment