Monday, October 15, 2018

Proposal: Electron dance

Timed out/quorumed 3 votes to 0. Enacted by Kevan.

Adminned at 18 Oct 2018 08:56:29 UTC

Add the following function to the Master Control Program, after the closing curly brace of the function “randomChar()”:

function shuffleArray(a) {
    for (let i = a.length - 1; i > 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        [a [ i ], a [ j ] ] = [a [ j ], a [ i ]];
    }
    return a;
}

Comments

Kevan: he/him

16-10-2018 08:04:24 UTC

for

derrick: he/him

16-10-2018 12:44:28 UTC

for

derrick: he/him

16-10-2018 13:29:17 UTC

wow, I just realized you did a swap on a single line using javascript! that’s some new syntax to go look up!

Brendan: he/him

16-10-2018 18:12:21 UTC

[derrick] It’s ES6, I think, which seems to work fine on the current hardware. I can’t take credit, though—it’s stolen from Stack Overflow.