Re:Test your “free will” at the Aaronson Oracle
by Bognar on Thursday June 02, 2016 @04:31PM
(#11825771)
This sequence seems to settle right around 50%:
var simulateKeyPress = function(character) {
var evt = document.createEvent("KeyboardEvent");
evt.initKeyEvent ("keypress", true, true, window,
0, 0, 0, 0,
0, character.charCodeAt(0))
document.body.dispatchEvent(evt);
};
var num = 0;
var loop = function() {
console.log(num);
var binary = num.toString(2);
num++;
for(var i = 0, len = binary.length; i < len; i++) {
simulateKeyPress(binary[i] == '0' ? 'd' : 'f');
}
};
setInterval(loop, 100);
Re:Test your “free will” at the Aaronson Oracle
by thaumasiotes on Thursday June 02, 2016 @04:41PM
(#11825859)
It might sound weird, but I actually found that more readable as three lines of code. :/
Re:Test your “free will” at the Aaronson Oracle
by steego on Thursday June 02, 2016 @04:14PM
(#11825656)
I wrote a program that counts but only appends the sequence if the binary sequence isn't already there.
Re:Test your “free will” at the Aaronson Oracle
by thaumasiotes on Thursday June 02, 2016 @04:31PM
(#11825773)
> but only appends the sequence if the binary sequence isn't already there
Why?
0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000...
(Granted, that is a transcendental number -- the Champernowne constant for base 2 -- but there's no real need to think of it that way.)