List

Try: ca/tecreations/ViewFile.php


<html>
<head>
<script>
const bees = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
const eyes = new Array(16,17,18,19,20,21,22,23,24,25,26,27,28,29,30);
const enns = new Array(31,32,33,34,35,36,37,38,39,40,41,42,43,44,45);
const gees = new Array(46,47,48,49,50,51,52,53,54,55,56,57,58,59,60);
const ohs = new Array(61,62,63,64,65,66,67,68,69,70,71,72,73,74,75);

function getArrayCount(variable) {
    return variable.length;
}

function getNextIndex(variable) {
    return Math.random() * getArrayCount(variable);
}

function alertNextIndex() {
    let nextIndex = Math.round(Math.random() * 5);
    if (nextIndex == 0) alertNextB();
    if (nextIndex == 1) alertNextI();
    if (nextIndex == 2) alertNextN();
    if (nextIndex == 3) alertNextG();
    if (nextIndex == 4) alertNextO();
    if (nextIndex == 5) alertNextIndex();
}

function alertNextB() {
    let index = Math.round(getNextIndex(bees));
    if (index < 0) {
        index = 0;
    } else if (index > getArrayCount(bees)) {
        index = getArrayCount(bees);
    }
    let aB = bees[index];
    alert(aB);
}

function alertNextI() {
    let index = Math.round(getNextIndex(eyes));
    if (index < 0) {
        index = 0;
    } else if (index > getArrayCount(eyes)) {
        index = getArrayCount(eyes);
    }
    let anI = eyes[index];
    alert(anI);
}

function alertNextN() {
    let index = Math.round(getNextIndex(enns));
    if (index < 0) {
        index = 0;
    } else if (index > getArrayCount(enns)) {
        index = getArrayCount(enns);
    }
    let anN = enns[index];
    alert(anN);
}

function alertNextG() {
    let index = Math.round(getNextIndex(gees));
    if (index < 0) {
        index = 0;
    } else if (index > getArrayCount(gees)) {
        index = getArrayCount(gees);
    }
    let aG = gees[index];
    alert(aG);
}

function alertNextO() {
    let index = Math.round(getNextIndex(ohs));
    if (index < 0) {
        index = 0;
    } else if (index > getArrayCount(ohs)) {
        index = getArrayCount(ohs);
    }
    let anO = ohs[index];
    alert(anO);
}

</script>
</head>
<body onload="alertNextIndex()">
</body>
</html>