Skip to content

Instantly share code, notes, and snippets.

@kjlubick
Created March 27, 2015 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjlubick/3f330d39efd7c6feaff3 to your computer and use it in GitHub Desktop.
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.
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