wordle-cli
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -20,2 +20,13 @@ const fs = require('fs') | ||
// VALIDATE WORD | ||
let validWordsBuffer = fs.readFileSync(path.join(__dirname, 'validWords.json')) | ||
let validWords = JSON.parse(validWordsBuffer) | ||
const validate = (word) => { | ||
if (words.includes(word) || validWords.includes(word)) { | ||
return true | ||
} | ||
} | ||
// SHOW WORD | ||
@@ -22,0 +33,0 @@ |
@@ -30,2 +30,6 @@ #! /usr/bin/env node | ||
return | ||
} else if (!word.validate(input.toLowerCase())) { | ||
console.log(`\n${input.toUpperCase()} is not a valid word!\n`) | ||
round() | ||
return | ||
} else if (!options.unlimited) { | ||
@@ -32,0 +36,0 @@ currentRound++ |
{ | ||
"name": "wordle-cli", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "CLI interpretation of the game Wordle", | ||
@@ -5,0 +5,0 @@ "main": "bin/index.js", |
152903
13226