mazes

I have created an algorithem that can solve a maze.  And I was wondering if anybody knew were there was an algorithem in C++ that can create a random maze.
hhartmanAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
AlexVirochovskyConnect With a Mentor Commented:
hhartman, sorry that I reply (and not ethick to other guys), but we wont
you reaction! What do you think, what helps/not helps you?
Sorry again, Alex
0
 
ozoCommented:
/* http://www.ioccc.org/1985/shapiro.c */
#define P(X)j=write(1,X,1)
#define C 39
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,
*d=N,c,e,f,g,i,j,k,s;main(){for(M[i=C*R-1]=24;f|d>=b;){c=M[g=i];i=e;for(s=f=0;
s<4;s++)if((k=m[s]+g)>=0&&k<C*R&&l[s]!=k%C&&(!M[k]||!j&&c>=16!=M[k]>=16))a[f++
]=s;if(f){f=M[e=m[s=a[rand()/(1+2147483647/f)]]+g];j=j<f?f:j;f+=c&-16*!j;M[g]=
c|1<<s;M[*d++=e]=f|1<<(s+2)%4;}else e=d>b++?b[-1]:e;}P(" ");for(s=C;--s;P("_")
)P(" ");for(;P("\n"),R--;P("|"))for(e=C;e--;P("_ "+(*u++/8)%2))P("| "+(*u/4)%2
);}
0
 
KangaRooCommented:
He did it again ;)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LucHoltkampCommented:
Are you competing in the obfucated C-contest ozo?
0
 
MirkwoodCommented:
I think hhartman meant a maze to find a route through not code that looks like a maze :-)
0
 
hhartmanAuthor Commented:
can anyone help me I really need an algoritum that can generate a map into a matrix?
All help is appreciated
0
 
KangaRooCommented:
How do you describe the maze (datastructure and such)
0
 
hhartmanAuthor Commented:
Your comments really helped.  From the sites I was able to use their algorithums to create one that suited my purposes.  I have been really busily lately and that is why I have not responded to you sooner
thanx
0
All Courses

From novice to tech pro — start learning today.