JSFiddle - React, Tailwind, and code Playground

JavaScript

// 1 User picks a subset of function names as a comma seperated string.
var effectSubset = 'func4, func5, func6';


// 2 Available functions
    function func1() {
        $('html').append('func1');
    }

    function func2() {
        $('html').append('func2');
    }

    function func3() {
        $('html').append('func3');
    }

    function func4() {
        $('html').append('func4');
    }

    function func5() {
        $('html').append('func3');
    }

    function func6() {
        $('html').append('func4');
    }


var autoPlay = function () {
    // 3 Get the user's subset of functions, turn into array
    effectArray = effectSubset.split(',');
    // 4 Pick random function from array
    var effect = effectArray[Math.floor(Math.random() * effectArray.length)];
    // 5 run the randomly picked function
    window[effect]();
}

// 6 Re-run every second
var playInterval = setInterval(autoPlay, 1000);