Created
March 27, 2015 13:27
-
-
Save kjlubick/3f330d39efd7c6feaff3 to your computer and use it in GitHub Desktop.
Fun with randoms. Uses random seeds to print out Hello, World. Found by guess and check.
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 FunWithRandoms { | |
public static void main(String[] args) | |
{ | |
Random helloWorld = new Random(95945573131518); | |
for(int i =0 ;i< 6;i++) { //Hello, | |
System.out.print((char)testRandom.nextInt(maxChar)); | |
} | |
helloWorld.setSeed(108269371030443); | |
for(int i =0 ;i< 6;i++) { //[space]World | |
System.out.print((char)testRandom.nextInt(maxChar)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment