Skip to content

Instantly share code, notes, and snippets.

@kabutz
Created January 12, 2015 21:57
Show Gist options
  • Save kabutz/653d9952f38a4be8cf59 to your computer and use it in GitHub Desktop.
Save kabutz/653d9952f38a4be8cf59 to your computer and use it in GitHub Desktop.
import java.lang.reflect.*;
public class SillyPuzzle {
public static void main(String... args) {
prepareForSillyPuzzle();
show(6 + 4);
show(9 + 2);
show(8 + 5);
show(5 + 2);
show(9 + 8);
show(10 + 6);
show(15 + 3);
}
private static void show(Integer total) {
System.out.println(total);
}
private static void prepareForSillyPuzzle() {
try {
Field value = Integer.class.getDeclaredField("value");
value.setAccessible(true);
value.set(10, 210);
value.set(11, 711);
value.set(13, 313);
value.set(7, 37);
value.set(17, 117);
value.set(16, 416);
value.set(18, 1218);
} catch (Exception silentlyIgnore) { }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment