wordle-cli
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -8,4 +8,4 @@ #! /usr/bin/env node | ||
// Define variables | ||
let currentRound = 0 | ||
let gameWon = false | ||
let history = [] | ||
const options = getOptions() | ||
@@ -35,4 +35,2 @@ const rounds = options.guesses || 6 | ||
return | ||
} else if (!options.unlimited) { | ||
currentRound++ | ||
} | ||
@@ -87,4 +85,6 @@ | ||
history.push(result) | ||
// Start new round or end game | ||
if (currentRound < rounds && !gameWon) { | ||
if ((options.unlimited || history.length < rounds) && !gameWon) { | ||
round() | ||
@@ -100,3 +100,3 @@ } else { | ||
if (gameWon) { | ||
messages.youWon(gameId, { unlimited: options.unlimited, currentRound, rounds }) | ||
messages.youWon(gameId, { unlimited: options.unlimited, roundsPlayed: history.length, rounds }) | ||
} else { | ||
@@ -116,2 +116,8 @@ console.log('Game over! The word was ' + wordOfTheDay.join('')) | ||
process.exit(0) | ||
} else if (options.guesses && options.unlimited) { | ||
console.log("You can't choose an amount of guesses in combination with the unlimited flag") | ||
process.exit(0) | ||
} else if (options.word && options.random) { | ||
console.log("You can't choose a custom word in combination with the random flag") | ||
process.exit(0) | ||
} else if (options.spoiler) { | ||
@@ -118,0 +124,0 @@ await word.show( |
@@ -24,3 +24,3 @@ const { insertSpaces } = require('./utils') | ||
if (gameId) stats.push(`#${gameId}`) | ||
if (!rounds.unlimited) stats.push(`${rounds.currentRound}/${rounds.rounds}`) | ||
if (!rounds.unlimited) stats.push(`${rounds.roundsPlayed}/${rounds.rounds}`) | ||
@@ -27,0 +27,0 @@ if (stats.length) statsOutput = `wordle ${stats.join(' ')}` |
{ | ||
"name": "wordle-cli", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "CLI interpretation of the game Wordle", | ||
@@ -5,0 +5,0 @@ "main": "bin/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
155117
9
13258