forked from ccouzens/maze
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDESIGN
More file actions
26 lines (25 loc) · 837 Bytes
/
DESIGN
File metadata and controls
26 lines (25 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Initial plan:
* Start simple
* Square maze
* Implement in C (because I'm learning C)
* Maybe use GLibs
* Represent maze as square array
* Go from top left to bottom right
* Output as text stars
* Represent each square as a struct
* stores if top and left border are filled in
* should squares know their location?
* Maze generation algorithm:
* 1 list
* Explored - square has been explored.
If it turns out that no neighbour remains unexplored this square gets removed.
* 1 array of square status (EXPLORED or UNEXPLORED)
* Put top left in explored and mark all other squares as unexplored.
* while there are squares in the explored list:
* Randomly pick an explored square
* Pick a direction at random (NESW) and as long as that square is unexplored, explore it.
* ******
* *
* ******
* *
****** *