Commit d61ac9cb authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent d93bf72b
...@@ -13,6 +13,11 @@ init() ...@@ -13,6 +13,11 @@ init()
let base = 1 let base = 1
let coms let coms
let files=['newCom1.json',
'newCom2.json',
'newCom3.json',
'newCom4.json']
//profitLossString //profitLossString
//drawDownString //drawDownString
...@@ -30,7 +35,8 @@ async function init() { ...@@ -30,7 +35,8 @@ async function init() {
} catch (e) { } catch (e) {
} }
coms = await fs.readFileSync('t.json', 'utf8'); let rand=randomInt(0,files.length)
coms = await fs.readFileSync(files[rand], 'utf8');
let bad = await fs.readFileSync('bad.txt', 'utf8'); let bad = await fs.readFileSync('bad.txt', 'utf8');
bad = JSON.parse(bad) bad = JSON.parse(bad)
...@@ -293,3 +299,8 @@ function createfileTorob(name, data) { ...@@ -293,3 +299,8 @@ function createfileTorob(name, data) {
}); });
}); });
} }
function randomInt(low, high) {
return Math.floor(Math.random() * (high - low) + low)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment