The correct way to write that code fragment would be:
if (Math.random() * 2 >= 1) return;
or:
if (Math.random() >= 0.5) return;
But the worst part is that he realised his cyberwarfare WMD wasn't working properly and deployed it anyway. I would not trust my geofence to keep the malware restricted to Belarus and Russia if I couldn't even figure out how to code a coinflip.
x4 makes the range [0,4] so (1,4] is 75% of range. Rounding down [1,1.5) to 1 is 1/8th of total range made not >1. 75% - 12.5% = 62.5%
Fuck Joe Brandon
Guy can't do basic math but of course he knows best when it comes to who should be allowed to have files on their computer.
The correct way to write that code fragment would be:
or:
But the worst part is that he realised his cyberwarfare WMD wasn't working properly and deployed it anyway. I would not trust my geofence to keep the malware restricted to Belarus and Russia if I couldn't even figure out how to code a coinflip.