River crossing game in Java