superrache
superrache

Reputation: 670

Is it possible to tweak your computer's random function?

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.

Upvotes: 0

Views: 127

Answers (1)

Ski
Ski

Reputation: 14497

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

Upvotes: 2

Related Questions