schat2-clive/assets/riddle-dedupe.js

20 lines
380 B
JavaScript
Raw Normal View History

2022-10-28 03:06:48 +00:00
'use strict';
const riddles = require('./riddles.json');
function init() {
const answers = new Map();
riddles.forEach((riddle) => {
riddle.answers.forEach((answer) => {
if (answers.has(answer)) {
console.log(`Possible duplicate, answer '${answer}' for ${riddle.riddle} ||| ${answers.get(answer).riddle}`);
}
answers.set(answer, riddle);
});
});
}
init();