File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
src/main/js/plugins/drone/contrib Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
// Maze generation based on http://rosettacode.org/wiki/Maze_generation#JavaScript
2
2
3
3
var Drone = require ( '../drone' ) . Drone ;
4
-
4
+ // User-facing code starts here
5
+ // Example: Try /js maze(5,7)
6
+ Drone . extend ( function maze ( size_x , size_y ) {
7
+ m = maze_make ( size_x , size_y ) ;
8
+ if ( m . x > 0 && m . y > 0 ) {
9
+ maze_draw ( maze_display ( m ) , this ) ;
10
+ }
11
+ } ) ;
12
+ //
13
+ // Implementation
14
+ //
5
15
function maze_make ( x , y ) {
6
16
var n = x * y - 1 ;
7
17
if ( n < 0 ) {
@@ -96,12 +106,3 @@ function maze_draw(maze_string, d) {
96
106
}
97
107
}
98
108
}
99
- function maze ( size_x , size_y ) {
100
- m = maze_make ( size_x , size_y ) ;
101
- if ( m . x > 0 && m . y > 0 ) {
102
- maze_draw ( maze_display ( m ) , this ) ;
103
- }
104
- }
105
- // User-facing code starts here
106
- // Example: Try /js amazing(5,7)
107
- Drone . extend ( maze ) ;
You can’t perform that action at this time.
0 commit comments