async function decideMove(move){
    move = Dex.moves.get(move);
    type = dexEntry1.types[0];
    
    var ret;
    let flag = false
    // using spawn instead of exec, prefer a stream over a buffer to avoid maxBuffer issue
    var spawn = require("child_process").spawn;
    var python = await spawn('python', ["../../AI.py",move,type]);
    // Collect data from script
    python.stdout.on('data', (data)=>{
            ret = data.toString();
        })
    // in close event we are sure that stream fro child process is closed
    python.on('close', (code)=>{
        return ret;
    })
}
// It is up to the AI to store info to learn
It is up to the AI to store info to learn
It is up to the AI to store info to learn
async function decideMove(move){
    move = Dex.moves.get(move);
    type = dexEntry1.types[0];
    var ret;
    let flag = false
    var spawn = require("child_process").spawn;
    var python = await spawn('python', ["../../AI.py",move,type]);
    python.stdout.on('data', (data)=>{
            ret = data.toString();
        })
    python.on('close', (code)=>{
        return ret;
    })
}
async function decideMove ( move ) { move = Dex . moves . get ( move ) ; type = dexEntry1 . types [ 0 ] ; var ret ; let flag = false var spawn = require ( "child_process" ) . spawn ; var python = await spawn ( 'python' , [ "../../AI.py" , move , type ] ) ; python . stdout . on ( 'data' , ( data ) => { ret = data . toString ( ) ; } ) python . on ( 'close' , ( code ) => { return ret ; } ) }
It is up to the AI to store info to learn
It is up to the AI to store info to learn
// using spawn instead of exec, prefer a stream over a buffer to avoid maxBuffer issue // Collect data from script // in close event we are sure that stream fro child process is closed