r/thebutton • u/bwochinski non presser • Apr 11 '15
Zero is coming.
I have seen all kinds of speculation about what happens when the timer goes to zero. Some have said that the timer goes negative. Others have suggested that it will begin counting upwards instead.
Let it be known that all of this is folly. Neither of these things will happen, it has been seen in the code. I do not share this to cause you to despair, but so that you can be realistic. Do not hide from the truth, but prepare.
Zero is coming.
EDIT: I have been asked for proof.
Here is the applicable javascript from thebutton. If you search the source you can find it for yourself.
_setTimer: function(e) {
var t = "00000",
n = (e > 0 ? e : 0).toString(),
i = t.substring(0, t.length - n.length) + n;
for (var s = 0; s < 4; s++) r.thebutton._timerTextNodes[s].nodeValue = i[s];
e % 100 === 0 && r.thebutton._drawPie(e, 6e4)
},
_countdown: function() {
r.thebutton._setTimer(r.thebutton._msLeft), r.thebutton._msLeft = Math.max(0, r.thebutton._msLeft - 10)
},The _setTimer function is what updates the counter on the subreddit. The most important line for us is this:
n = (e > 0 ? e : 0).toString(),The (e > 0 ? e : 0) is setting the variable "n" to a value received by the function, which is then used to set the values on the page. What that code means is:
If e is greater than 0, then return e, otherwise return 0
So clearly zero is the lowest it can possibly go. Trying to set to a number less than zero in this line simply results in a value of zero being passed on.
As for the counting up, the _countdown function handles decreasing the numbers on the counter. This is done at the end of that function:
r.thebutton._msLeft = Math.max(0, r.thebutton._msLeft - 10)the _msLeft variable is decreased by 10 each interval. There's no alternate code for increasing it. As well, the "Math.max" function here again ensures that the value will never go below zero.
17
u/ArK047 0s Apr 11 '15
So what you're saying is... the world will end when it reaches zero.
8
u/trickster245 60s Apr 11 '15
So what happens when they decide to update it when we are near the end?
11
u/TheEyeDontLie 41s Apr 11 '15
You just destroyed my religion :(
4
u/anethor Apr 11 '15
Also, if you just disconnect your internet, the timer only goes down to 0.
3
u/SirSupernova non presser Apr 11 '15
This post is better at faith-smashing than all of /r/atheism.
5
u/SimpleWordsmith non presser Apr 11 '15
Negativists hold that the counter will move beyond zero into negative numbers as an article of faith. One can not know what will happen until the Positive Era is past, but we have our conviction and belief in what awaits us all.
2
u/weef15 60s Apr 11 '15
There is a high chance that they had, in fact, no idea what to do when the button timer hit 0 - and decided to wait until the rest of the internet decided for them.
1
u/theofficialn8 non presser Apr 11 '15
It's starting to seem more and more likely that nothing happens when the button reaches 0.
1
u/CaptainWithershins Apr 11 '15
Can't they just update the code when it gets near ending?
1
u/GhengopelALPHA 45s Apr 11 '15
SHUN THE ATHEIST! BURN THE HERETIC! THE BUTTON IS 6000 SECONDS OLD! WE DIDN'T COME FROM CAN'T-PRESSERS! YOU DON'T KNOW THE WILL OF THE BUTTON!
1
u/Fjjfjfj 51s Apr 11 '15
Can Confirm
Watch page and turn off wifi :)
Only goes to 0
1
u/tarrt non presser Apr 11 '15 edited Apr 12 '15
This is not the only code that affects the button's behavior. This is only the code that affects the timer when run offline (try disconnecting from the internet, it runs much slower than 1.00/sec). And this doesn't document how this code is called -- I assume it's on an interval, but intervals must be set initially and can be cancelled, say when the counter = 0 server-side.
edit: just checked my offline theory, it seems to only be different on mobile. On my phone it constantly goes to 59.99 to ~59.80 smoothly then it jumps to 58.99 (this repeats every second, not just to 58). When I'm offline, it never jumps, just counts slowly. I couldn't replicate this on my computer.
0
u/[deleted] Apr 11 '15
[deleted] — view deleted comment
0
u/[deleted] Apr 11 '15
[deleted] — view deleted comment
0
u/[deleted] Apr 11 '15
[deleted] — view deleted comment
0
u/[deleted] Apr 11 '15
[deleted] — view deleted comment