Compare commits
2 Commits
67cd8f7fe1
...
9027022d4d
| Author | SHA1 | Date |
|---|---|---|
|
|
9027022d4d | 3 years ago |
|
|
71c245774d | 3 years ago |
1 changed files with 21 additions and 0 deletions
@ -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) |
||||
Loading…
Reference in new issue