        MaZeR 2 <--> Ralf Nieuwenhuijsen <-> Legal stuff in MaZeR.E
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Calling MaZeR.E
    ---------------
        To include a maze in your program you must call this routine
            which returns a 2D sequence containg the 'MaZe Picture'
            
            sequence = mazer ( { WIDTH , HEIGHT } , OPTIONS )
        
        WIDTH and HEIGHT specify the size of the maze picture to return,
            the size will be one more than you specify, since it has to
            have borders on both sides.
        OPTIONS is a sequence containing all the values needed for an
            maze. The structure of the options sequence is described later 
            on in this file.
        
    The 'MaZe Picture'
    ---------------------
        The sequence return is an 2d sequence with the 'MaZe Picture'
        In the 'MaZe Picture' are all the values above 0 walls.
        You can if you want include a 'MaZe Picture' in the options 
            sequence. The maze will then be draw around the picture 
            already in it.
        If you include a 'MaZe Picture' all the values above 0 are
            considered walls, all the values beneath 1 are considered 
            open spaces.
        If you do not include a 'MaZe Picture' an empty one is created with
            all the spaces of the value 0. A border is then automatically 
            created. 
        If you do include a 'MaZe Picture' the picture data must include a
            border or the routines will fail!!
            
    The options sequence
    -----------------------
        This is the hardest part, and requires much of your time, but once
            done, you can use your options each time you want a MaZe to be
            created in a specific style.
        You should play with the values to see what they do, and try to find
            original combinations that create a cool new style.
        A few styles are listed under here and you can easily copy them,
            but for better understanding of the style, you better not skip
            this part.
            
        Including a 'MaZe Picture'
        ----------------------------
            The highest level of the options sequence looks like this:

                {sequence maze_layers, [sequence user_map]}

            The sequence user_map is a 'MaZe Picture' and is optional.
            If you want to start with an empty user_map, use this:
        
                {sequence maze_layers}
            
            The sequence maze_layers is a very special sequence containg the 
                rest of the options for each layer of a maze.
                
        MaZe Layers
        -------------
            For the best effects you would want your maze to be drawn several
                times with different options. 
            Well this is how you do it.
            Each maze layers contain information about the maze style, size
                and other options.
            The maze layers are being drawn in same order as the layers are
                in the maze_layers sequence.
            It is just a sequence containing sequences containing the real 
                options.
            
            Example:
                
                { { options_for_layer1 , options_for_layer2 } , user_map }

            Remember that the user_map is optional!!
            If the layer_sequence is a 0-length sequence the mazer function
                will only return a 2d-sequence with borders!!            
        
        Layer Options
        ---------------
            The layer options are stored in one big sequence.
            The number of elements is fixed, it is 6.
            They are discribed with detail now.        
            Each time i call something default i do not mean that you do not 
                have to specify that value, i mean that that are the
                most-wanted values.
            
            1 --> Space between the lines/walls, minimum = 2,
                            maximum = width / 2.
                    The space can NEVER be more than any previous layers.
                    
            2 --> Finishing speed, 1 is the default, the value is being 
                        multiplyd with the number of tries before the maze
                        will be linear completed.
            
            3 --> 3.1 --> Do linear fill: 1 = yes, any other value = no
                  3.2 --> Linear fill vertical direction.
                            constant D2U = 1 --> Down to Up   (default)
                            constant U2D = 2 --> Up to Down   (possibility)
                  3.3 --> Linear fill same direction chance
                            it's the same as 5.3 but then used when filling.
                  3.4 --> Linear fill different direction chance
                            it's the same as 5.4 but then used when filling.
                                            
            4 --> 4.1 --> Random Point Select Method
                            This is a 3-element sequence containing relative
                                values to the three different methods.
                            
                            It's like this: { border , space , wall }
                            
                            Border method selects a point on the border.
                            Space method selects a point at an open space.
                            Wall method selects a point at an line/wall.
                            
                            Example:    {10,5,5}
                            
                            The chance that a point uses..
                                ..method Border is 10 of 20 thus 1/2
                                ..method Space is 5 of 20 thus 1/4
                                ..method Wall is 5 of 20 thus 1/4
                                
                            The have the same chance for each method simple 
                                use this: {1,1,1}
                            To make sure a method is not used make a zero 
                                out of it!
                                
                  4.2 --> A 4-element sequence containing relative chances
                                for each side of the border.
                            The sides are: {UP,RIGHT,DOWN,LEFT}                            
                            Use this to have the same chance for each side:
                                {1,1,1,1}                      
            
            5 --> 5.1 --> Central Position, a 2-element sequence containing
                            the central position's x and y values.
                          The lines will have an urge to go to or from the 
                            center depending on the value of 5.2
                          The sequence layout is { X , Y }
                  
                  5.2 --> Value between -9 and 9 that sets the urge to the
                            draw a line to the center.
                            
                          With the value 0 no urge exists.
                          With the value 5 a normal urge towards exists.
                          With the value 9 a big urge towards exists.
                          With the value -5 a normal urge to move away exists
                          With the value -9 a big urg to move away exists.
                          ...etc.

                  5.3 --> Value between 0 and 10, which specifies the chance
                            that a line will be drawn in the same direction.
                          
                          Value  0 :  Always choose another direction
                          Value 10 :  Continue in this direction as long as
                                        possible.
                          Value  5 :  Chance to continue in the same
                                        direction is 5/10.
                          ...etc.
                          
                  5.4 --> Value between 0 and 10, which specifies the chance
                            that he will try to continue to draw a line
                            before he chooses a new point.
                            
                          Value  0 :  Always choose another point
                          Value 10 :  Always make the line as long as 
                                        possible.
                          Value  5 : Chance to continue the line in any
                                        direction is 5/10.
                                        
            6 --> Line Color, the color of the lines/walls.
                  Set this value to a character for an ascII-maze.
                  Keep this value 1 or above!!  
                                        
        A few example styles of the options sequence.                  
        ------------------------------------------------
        
            Style 1, Die Hard
            -----------------
                This style generates a very difficult maze, where you
                    have no idea where to go...
                
                options_sequence = 
 {{
   { SPACE*2 ,1,{0,1},{{10,3,10},{1,1,1,1}},{{ CPX , CPY },0,0,10}, COLOR },
   { SPACE   ,1,{1,1},{{10,3,10},{1,1,1,1}},{{ CPX , CPY },0,0,10}, COLOR }
                                                                           }}
                    
             *  For SPACE you must enter how much space you want between 
                    the lines.
             *  For CPX and CPY you must enter the center positions of the
                    the maze. (Normally x --> width/2, y --> height /2)
             *  For COLOR you must enter which value the engine should use
                    to draw your maze (I'm talking about the line/wall color)
                    
            Style 2, Castle
            ---------------
                This style generates a very irritating maze full of lines 
                    that really hurts your eyes if you look too long at them.

                options_sequence = 
 {{
   { SPACE*2 ,1,{0,1,0,10},{{10,3,10},{1,1,1,1}},{{ CPX , CPY },0,0,10}, COLOR },
   { SPACE  ,1,{1,1,10,10},{{0,3,10},{1,1,1,1}},{{ CPX , CPY },-9,10,10}, COLOR }
                                                                           }}
                    
            Style 3, Fort
            -------------
                This generates a maze that makes you think of a fort, it is
                    hard to get to the center...
                    
                options_sequence = 
 {{
   { SPACE*2 ,1,{0,1,10,10},{{0,10,10},{1,1,1,1}},{{ CPX , CPY },-9,10,10},COLOR},
   { SPACE   ,1,{1,1,10,10},{{10,0,10},{1,1,1,1}},{{ CPX , CPY },0,10,10}, COLOR}
                                                                           }}
            More styles
            -----------
                If you want more styles, contact me, Ralf Nieuwenhuijsen
                    or play with the options sequence and make your own!
                    
    For more information
    --------------------
        For more information or questions about these explenations or about 
            the engine, you can email me at: nieuwen@xs4all.nl
        
        Hope you will enjoy these routines,
                    
                Ralf Nieuwenhuijsen      

