This commit is contained in:
asyncnomi 2023-01-09 16:12:34 +01:00
parent 6c7d0801c2
commit 71c245774d

21
stats.js Normal file
View file

@ -0,0 +1,21 @@
const fs = require('fs');
let PrankData = JSON.parse(fs.readFileSync("prankdata.txt"));
let nbPrank;
let nbCrepe;
let meanCrepe;
for (var uid in PrankData) {
if (PrankData[uid].type == "crêpe") {
if (PrankData[uid].state == "Done") {
nbPrank ++;
nbCrepe += PrankData[uid].amount
}
}
}
meanCrepe = nbCrepe / nbPrank;
console.log("Nombre de mission mission achevé: " + nbPrank)
console.log("Nombre de crêpe servis: " + nbCrepe)
console.log("Nombre moyen de crêpe par demande: " + meanCrepe)