Created
January 19, 2016 12:32
-
-
Save ralphsaunders/66787ea24b0860b6ccbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
public class Hagrid { | |
final static List<String> compass = new ArrayList<>(Arrays.asList("N","E","S","W")); | |
public static void main(String[] args) { | |
File root = new File("C:/Users/.../Desktop/Hedge Maze"); | |
gogogo(root,100); | |
} | |
public static void gogogo(File root, int depth) { | |
if (depth == 0) return; | |
for (String s : compass) { | |
File subdir = new File(root,s); | |
subdir.mkdirs(); | |
gogogo(subdir,depth-1); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment