<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Perfect maze generation with AS3</title>
	<atom:link href="http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/</link>
	<description>italian geek and PROgrammer</description>
	<lastBuildDate>Fri, 10 Feb 2012 12:12:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Carl</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-588501</link>
		<dc:creator>Carl</dc:creator>
		<pubDate>Thu, 10 Jun 2010 13:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-588501</guid>
		<description>Great script 

Is there a way to get the starting point and ending point from the script


Thanka</description>
		<content:encoded><![CDATA[<p>Great script </p>
<p>Is there a way to get the starting point and ending point from the script</p>
<p>Thanka</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: a guy</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-447296</link>
		<dc:creator>a guy</dc:creator>
		<pubDate>Mon, 11 May 2009 09:08:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-447296</guid>
		<description>here it is and done

maze_width = 24;
maze_height = 19;
wall_size = 20;
maze = new Array();
my_moves = new Array();
_root.createEmptyMovieClip(&quot;maze_draw&quot;, 1);
cell_count = maze_width*maze_height;
pos = Math.floor(Math.random()*cell_count);
visited = 1;
for (i=0; i&lt;cell_count; i++) {
	maze[i] = new Array(0, 1, 1, 1, 1);
}
maze[pos][0] = 1;
while (visited&lt;cell_count) {
	var possible = &quot;&quot;;
	if ((Math.floor(pos/maze_width) == Math.floor((pos-1)/maze_width)) &amp;&amp; (maze[pos-1][0] == 0)) {
		possible = possible+&quot;W&quot;;
	}
	if ((Math.floor(pos/maze_width) == Math.floor((pos+1)/maze_width)) &amp;&amp; (maze[pos+1][0] == 0)) {
		possible = possible+&quot;E&quot;;
	}
	if (((pos+maze_width)=0) &amp;&amp; (maze[pos-maze_width][0] == 0)) {
		possible = possible+&quot;N&quot;;
	}
	if (possible) {
		visited++;
		my_moves.push(pos);
		var way = possible.charAt(Math.floor(Math.random()*possible.length));
		switch (way) {
		case &quot;N&quot; :
			maze[pos][1] = 0;
			maze[pos-maze_width][2] = 0;
			pos -= maze_width;
			break;
		case &quot;S&quot; :
			maze[pos][2] = 0;
			maze[pos+maze_width][1] = 0;
			pos += maze_width;
			break;
		case &quot;E&quot; :
			maze[pos][3] = 0;
			maze[pos+1][4] = 0;
			pos++;
			break;
		case &quot;W&quot; :
			maze[pos][4] = 0;
			maze[pos-1][3] = 0;
			pos--;
			break;
		}
		maze[pos][0] = 1;
	} else {
		pos = my_moves.pop();
	}
}
maze_draw.lineStyle(1);
maze_draw.moveTo(10, 10);
start_y = 10-wall_size;
start_x = 0;
for (i=0; i&lt;cell_count; i++) {
	start_x += wall_size;
	if (((i/maze_width)-Math.floor(i/maze_width)) == 0) {
		start_y += wall_size;
		start_x = 10;
	}
	if (maze[i][2] == 1) {
		maze_draw.moveTo(start_x, start_y+wall_size);
		maze_draw.lineTo(start_x+wall_size, start_y+wall_size);
	}
	if (maze[i][3] == 1) {
		maze_draw.moveTo(start_x+wall_size, start_y);
		maze_draw.lineTo(start_x+wall_size, start_y+wall_size);
	}
}
maze_draw.lineStyle(2, 0x000000);
maze_draw.moveTo(10, 10);
maze_draw.lineTo(10+wall_size*maze_width, 10);
maze_draw.lineTo(10+wall_size*maze_width, 10+wall_size*maze_height);
maze_draw.lineTo(10, 10+wall_size*maze_height);
maze_draw.lineTo(10, 10);</description>
		<content:encoded><![CDATA[<p>here it is and done</p>
<p>maze_width = 24;<br />
maze_height = 19;<br />
wall_size = 20;<br />
maze = new Array();<br />
my_moves = new Array();<br />
_root.createEmptyMovieClip(&#8220;maze_draw&#8221;, 1);<br />
cell_count = maze_width*maze_height;<br />
pos = Math.floor(Math.random()*cell_count);<br />
visited = 1;<br />
for (i=0; i&lt;cell_count; i++) {<br />
	maze[i] = new Array(0, 1, 1, 1, 1);<br />
}<br />
maze[pos][0] = 1;<br />
while (visited&lt;cell_count) {<br />
	var possible = &#8220;&#8221;;<br />
	if ((Math.floor(pos/maze_width) == Math.floor((pos-1)/maze_width)) &amp;&amp; (maze[pos-1][0] == 0)) {<br />
		possible = possible+&#8221;W&#8221;;<br />
	}<br />
	if ((Math.floor(pos/maze_width) == Math.floor((pos+1)/maze_width)) &amp;&amp; (maze[pos+1][0] == 0)) {<br />
		possible = possible+&#8221;E&#8221;;<br />
	}<br />
	if (((pos+maze_width)=0) &amp;&amp; (maze[pos-maze_width][0] == 0)) {<br />
		possible = possible+&#8221;N&#8221;;<br />
	}<br />
	if (possible) {<br />
		visited++;<br />
		my_moves.push(pos);<br />
		var way = possible.charAt(Math.floor(Math.random()*possible.length));<br />
		switch (way) {<br />
		case &#8220;N&#8221; :<br />
			maze[pos][1] = 0;<br />
			maze[pos-maze_width][2] = 0;<br />
			pos -= maze_width;<br />
			break;<br />
		case &#8220;S&#8221; :<br />
			maze[pos][2] = 0;<br />
			maze[pos+maze_width][1] = 0;<br />
			pos += maze_width;<br />
			break;<br />
		case &#8220;E&#8221; :<br />
			maze[pos][3] = 0;<br />
			maze[pos+1][4] = 0;<br />
			pos++;<br />
			break;<br />
		case &#8220;W&#8221; :<br />
			maze[pos][4] = 0;<br />
			maze[pos-1][3] = 0;<br />
			pos&#8211;;<br />
			break;<br />
		}<br />
		maze[pos][0] = 1;<br />
	} else {<br />
		pos = my_moves.pop();<br />
	}<br />
}<br />
maze_draw.lineStyle(1);<br />
maze_draw.moveTo(10, 10);<br />
start_y = 10-wall_size;<br />
start_x = 0;<br />
for (i=0; i&lt;cell_count; i++) {<br />
	start_x += wall_size;<br />
	if (((i/maze_width)-Math.floor(i/maze_width)) == 0) {<br />
		start_y += wall_size;<br />
		start_x = 10;<br />
	}<br />
	if (maze[i][2] == 1) {<br />
		maze_draw.moveTo(start_x, start_y+wall_size);<br />
		maze_draw.lineTo(start_x+wall_size, start_y+wall_size);<br />
	}<br />
	if (maze[i][3] == 1) {<br />
		maze_draw.moveTo(start_x+wall_size, start_y);<br />
		maze_draw.lineTo(start_x+wall_size, start_y+wall_size);<br />
	}<br />
}<br />
maze_draw.lineStyle(2, 0&#215;000000);<br />
maze_draw.moveTo(10, 10);<br />
maze_draw.lineTo(10+wall_size*maze_width, 10);<br />
maze_draw.lineTo(10+wall_size*maze_width, 10+wall_size*maze_height);<br />
maze_draw.lineTo(10, 10+wall_size*maze_height);<br />
maze_draw.lineTo(10, 10);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: a guy</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-447286</link>
		<dc:creator>a guy</dc:creator>
		<pubDate>Mon, 11 May 2009 08:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-447286</guid>
		<description>u know, this could be done in AS2.0, it would just need a little more work to get it done</description>
		<content:encoded><![CDATA[<p>u know, this could be done in AS2.0, it would just need a little more work to get it done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Little Boy In The Puff Ball Hat</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-356077</link>
		<dc:creator>Little Boy In The Puff Ball Hat</dc:creator>
		<pubDate>Wed, 17 Dec 2008 22:40:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-356077</guid>
		<description>The Little Boy In The Puff Ball Hat Said &quot;I Agree With Arxanas!!!!!!&quot;</description>
		<content:encoded><![CDATA[<p>The Little Boy In The Puff Ball Hat Said &#8220;I Agree With Arxanas!!!!!!&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Perfect maze generation - tile based version : Emanuele Feronato</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-349129</link>
		<dc:creator>Perfect maze generation - tile based version : Emanuele Feronato</dc:creator>
		<pubDate>Sat, 06 Dec 2008 12:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-349129</guid>
		<description>[...] reason is simple: in Perfect maze generation with AS3 post and previous ones I just showed you how to make a perfect maze, but it&#8217;s not the kind of [...]</description>
		<content:encoded><![CDATA[<p>[...] reason is simple: in Perfect maze generation with AS3 post and previous ones I just showed you how to make a perfect maze, but it&#8217;s not the kind of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xavi</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-346955</link>
		<dc:creator>xavi</dc:creator>
		<pubDate>Mon, 01 Dec 2008 17:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-346955</guid>
		<description>that&#039;s pretty cool.
the only thing if you are going to make it into a dungeon, is that it will have to have big rooms and empty spaces where you can&#039;t walk.
other than that, awesome!</description>
		<content:encoded><![CDATA[<p>that&#8217;s pretty cool.<br />
the only thing if you are going to make it into a dungeon, is that it will have to have big rooms and empty spaces where you can&#8217;t walk.<br />
other than that, awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quarky Quantum</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-346552</link>
		<dc:creator>Quarky Quantum</dc:creator>
		<pubDate>Mon, 01 Dec 2008 03:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-346552</guid>
		<description>As soon as I read this post I thought 2 things:
1: The same thing that Arxanas said.
2: Make a updated version of TileBall with the maps randomly made using this.</description>
		<content:encoded><![CDATA[<p>As soon as I read this post I thought 2 things:<br />
1: The same thing that Arxanas said.<br />
2: Make a updated version of TileBall with the maps randomly made using this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arxanas</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-346019</link>
		<dc:creator>Arxanas</dc:creator>
		<pubDate>Sun, 30 Nov 2008 02:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-346019</guid>
		<description>Hey, do you remember that one Windows 2000 screensaver with the customizable 3-D maze?

What if somebody made an AI to move through the maze and check possibilities (like in the screensaver) until if found the end?

That would be cool. I would love to do it but I can&#039;t for 2 reasons:

1. I suck at AS3
2. I suck at making AI&#039;s</description>
		<content:encoded><![CDATA[<p>Hey, do you remember that one Windows 2000 screensaver with the customizable 3-D maze?</p>
<p>What if somebody made an AI to move through the maze and check possibilities (like in the screensaver) until if found the end?</p>
<p>That would be cool. I would love to do it but I can&#8217;t for 2 reasons:</p>
<p>1. I suck at AS3<br />
2. I suck at making AI&#8217;s</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: subblue</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-345849</link>
		<dc:creator>subblue</dc:creator>
		<pubDate>Sat, 29 Nov 2008 20:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-345849</guid>
		<description>Very interesting, thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Very interesting, thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeanpier</title>
		<link>http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/#comment-345058</link>
		<dc:creator>jeanpier</dc:creator>
		<pubDate>Fri, 28 Nov 2008 18:33:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=675#comment-345058</guid>
		<description>Nice tutorial!</description>
		<content:encoded><![CDATA[<p>Nice tutorial!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 6/11 queries in 0.010 seconds using disk: basic

Served from: www.emanueleferonato.com @ 2012-02-11 04:46:46 -->
