Based on https://code.google.com/p/android-nethack-port