Newer
Older
ryuei / gachaSystem.js
@Ryuei Ryuei on 15 Nov 2022 558 bytes fix code
function main(){
    function getCSV(){
        var req = new XMLHttpRequest(); 
        req.open("get", "gachaSystem.csv", true); 
        req.send(null); 
        req.onload = function(){
        convertCSVtoArray(req.responseText); 
        }
    }


    function convertCSVtoArray(str){
        var result = [];
        var tmp = str.split("\n"); 
        for(var i=0;i<tmp.length;++i){
            result[i] = tmp[i].split(',');
        }
        console.log(result[8]);
    }
    getCSV();
};
document.addEventListener("DOMContentLoaded", main, false);