<<set $posy = $posy - 1>>\n<<navigate>>\n<<if $North eq 1>>\n[[North]]\n<<endif>>\n<<if $South eq 1>>\n[[South]]\n<<endif>>\n<<if $West eq 1>>\n[[West]]\n<<endif>>\n<<if $East eq 1>>\n[[East]]\n<<endif>>\n<<if $Exit eq 1>>\n[[Exit]]\n<<endif>>
<<set $posx = $posx - 1>>\n<<navigate>>\n<<if $North eq 1>>\n[[North]]\n<<endif>>\n<<if $South eq 1>>\n[[South]]\n<<endif>>\n<<if $West eq 1>>\n[[West]]\n<<endif>>\n<<if $East eq 1>>\n[[East]]\n<<endif>>\n<<if $Exit eq 1>>\n[[Exit]]\n<<endif>>
<<navigate>>\n<<if $North eq true>>\n[[North]]\n<<endif>>\n<<if $South eq true>>\n[[South]]\n<<endif>>\n<<if $West eq true>>\n[[West]]\n<<endif>>\n<<if $East eq true>>\n[[East]]\n<<endif>>
<<display "Maze Addon">>\n\n[[Enter Dungeon]]
<<silently>>\n<<set $MazeAddon =\nfunction() \n{\n \n var maze = [[0,0,0,0,0,0,0,0,0,0,0],\n[0,1,1,1,0,1,1,1,1,1,0],\n[0,0,0,1,0,0,0,0,0,1,0],\n[0,1,0,1,1,1,1,1,0,1,0],\n[0,1,0,0,0,0,0,1,0,1,0],\n[0,1,1,1,1,1,1,1,0,1,0],\n[0,0,0,0,0,0,0,1,0,1,0],\n[0,1,0,1,1,1,1,1,1,1,0],\n[0,1,0,1,0,0,0,1,0,0,0],\n[0,1,1,1,0,1,1,1,1,2,0],\n[0,0,0,0,0,0,0,0,0,0,0]];\n \n var x = 1;\n var y = 1;\n \n $posx = 1;\n $posy = 1;\n \n macros['navigate'] =\n\t{\n\t\thandler: function(obj, fnc, val)\n\t\t{\n\t\t\tx = $posx; y = $posy;\n if(maze[y-1][x] eq 1)\n { $North = 1; } \n else if(maze[x][y+1] eq 2) {$Exit = 1;}\n else {$North = 0;}\n \n if(maze[y+1][x] eq 1) \n { $South = 1; } \n else if(maze[x][y-1] eq 2) {$Exit = 1;}\n else {$South = 0;}\n \n if(maze[y][x-1] eq 1) \n { $West = 1; } \n else if(maze[x-1][y] eq 2) {$Exit = 1;}\n else {$West = 0;}\n \n if(maze[y][x+1] eq 1) \n { $East = 1; } \n else if(maze[x+1][y] eq 2) {$Exit = 1;}\n else {$East = 0;}\n\t\t}\n\t}\n \n \n}\n>>\n<<print $MazeAddon()>>\n<<endsilently>>
@videlais
Sugarcane: Moving through a 'Dungeon'
<<set $posx = $posx + 1>>\n<<navigate>>\n<<if $North eq 1>>\n[[North]]\n<<endif>>\n<<if $South eq 1>>\n[[South]]\n<<endif>>\n<<if $West eq 1>>\n[[West]]\n<<endif>>\n<<if $East eq 1>>\n[[East]]\n<<endif>>\n<<if $Exit eq 1>>\n[[Exit]]\n<<endif>>
<<set $posy = $posy + 1>>\n<<navigate>>\n<<if $North eq 1>>\n[[North]]\n<<endif>>\n<<if $South eq 1>>\n[[South]]\n<<endif>>\n<<if $West eq 1>>\n[[West]]\n<<endif>>\n<<if $East eq 1>>\n[[East]]\n<<endif>>\n<<if $Exit eq 1>>\n[[Exit]]\n<<endif>>