Created
September 29, 2014 13:46
-
-
Save johanbrook/5a535364f574aab6654f to your computer and use it in GitHub Desktop.
Recursive doll counter.
This file contains 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
public static int recursiveDollCounter(Doll doll) { | |
if(doll.isCore()) { | |
return 0; | |
} | |
else { | |
doll.removeOuterLayer(); | |
return recursiveDollCounter(doll) + 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment