Created
March 30, 2014 17:11
-
-
Save rtoal/9876084 to your computer and use it in GitHub Desktop.
Something I found and cleaned up a little bit
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
import java.util.Random; | |
public class Mystery { | |
public static void main(String[] args) { | |
System.out.println(randomString(-229985452) + " " + randomString(-147909649)); | |
} | |
private static String randomString(int code) { | |
Random random = new Random(code); | |
StringBuilder builder = new StringBuilder(); | |
while (true) { | |
int c = random.nextInt(27); | |
if (c == 0) break; | |
builder.append((char)('`' + c)); | |
} | |
return builder.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment