문제

In order to cheat the game 2048 for fun, does anyone know how to change the random implementation on Windows or Linux? On a linux kernel, I guess that you reimplement the rand function simply like this:

double rand() {
  return 0.0;
}

then rebuild your kernel.

But no idea on Windows.

I would appreciate any help on it.

도움이 되었습니까?

해결책

In order to beat 2048 simply open your web browser's console while playing the game and type in:

Math.random = function() { return 0.0 }

In firefox it is Tools -> Web developer -> Web console

In Chromium it is Tools -> Javascript console.

P.S. I had to check if it's not yet April 1st as rebuilding kernel in order to cheat a web game sounds a bit too extreme

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top