Skip to content

Instantly share code, notes, and snippets.

@yonigoldberg
Created February 20, 2013 14:59
Show Gist options
  • Save yonigoldberg/4996131 to your computer and use it in GitHub Desktop.
Save yonigoldberg/4996131 to your computer and use it in GitHub Desktop.
Super easy override
public class MagicLand {
public static void main(String[] args) {
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
System.out.println("UNICORN #1: PAT THIS UNICORN ONCE");
}
}
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
System.out.println("UNICORN #2: PAT THIS UNICORN ONCE");
}
}
System.out.println("END OF PROGRAM");
}
private static class Math {
public static double random() {
return -0.002;
}
}
private static class Unicorn {
public static boolean pat() {
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment