It's just a algorithm,the file is C++ algorithm source program not include MFC files but you should port it in the MFC of VS2010
<p>OK, here's a C program to create a maze: </p><p><a href="http://www.gtoal.com/logoforum/maze.c.html" rel="nofollow">http://www.gtoal.com/logoforum/maze.c.html</a></p><p>I didn't write the maze generation algorithm; I pinched it from<br><a href="http://homepages.cwi.nl/~tromp/maze.html" rel="nofollow">http://homepages.cwi.nl/~tromp/maze.html</a> - and I take my hat off to<br>the crazy genius who wrote it. Non-recursive, top-to-bottom<br>generation. Wow.</p><p>Here's the underlying code...</p><blockquote>char M[3],A,Z,E=40,J[40],T[40];main(C){for(*J=A=scanf(&quot;%d&quot;,&amp;C);<br>-- E; J[ E] =T<br>[E ]= E) printf(&quot;._&quot;); for(;(A-=Z=!Z) || (printf(&quot;\n|&quot;<br>) , A = 39 ,C --<br>) ; Z || printf (M ))M[Z]=Z[A-(E =A[J-Z])&amp;&amp;!C<br>&amp; A == T[ A]<br>|6&lt;&lt;27&lt;rand()||!C&amp;!Z?J[T[E]=T[A]]=E,J[T[A]=A-Z]=A,&quot;_.&quot;:&quot; |&quot;];}</blockquote><p>(It might look better at <a href="http://www.gtoal.com/logoforum/tromp.c.html" rel="nofollow">http://www.gtoal.com/logoforum/tromp.c.html</a> )</p><p>Alternatively, try this:</p><blockquote>#define P(X)j=write(1,X,1)<br>#define C 39<br>int M[5000]={2},*u=M,N[5000],R=22,a[4],l[]={0,-1,C-1,-1},m[]={1,-C,-1,C},*b=N,<br>*d=N,c,e,f,g,i,j,k,s;main(){for(M[i=C*R-1]=24;f|d&gt;=b;){c=M[g=i];i=e;for(s=f=0;<br>s&lt;4;s++)if((k=m[s]+g)&gt;=0&amp;&amp;k&lt;C*R&amp;&amp;l[s]!=k%C&amp;&amp;(!M[k]||!j&amp;&amp;c&gt;=16!=M[k]&gt;=16))a[f++<br>]=s;if(f){f=M[e=m[s=a[rand()/(1+2147483647/f)]]+g];j=j&lt;f?f:j;f+=c&amp;-16*!j;M[g]=<br>c|1&lt;&lt;s;M[*d++=e]=f|1&lt;&lt;(s+2)%4;}else e=d&gt;b++?b[-1]:e;}P(&quot; &quot;);for(s=C;--s;P(&quot;_&quot;)<br>)P(&quot; &quot;);for(;P(&quot;\n&quot;),R--;P(&quot;|&quot;))for(e=C;e--;P(&quot;_ &quot;+(*u++/8)%2))P(&quot;| &quot;+(*u/4)%2<br>);}</blockquote><p>(See <a href="http://www.gtoal.com/logoforum/shapiro.c.html" rel="nofollow">http://www.gtoal.com/logoforum/shapiro.c.html</a> )</p>