wordle-cli
Advanced tools
Comparing version 1.1.6 to 1.1.7
#! /usr/bin/env node | ||
const { createInterface } = require('readline') | ||
const word = require('./functions') | ||
const word = require('./wordFunctions') | ||
const getOptions = require('./getOptions') | ||
@@ -5,0 +5,0 @@ const messages = require('./messages') |
@@ -0,1 +1,3 @@ | ||
const { insertSpaces } = require('./utils') | ||
module.exports = { | ||
@@ -18,14 +20,14 @@ title() { | ||
youWon(gameId, rounds) { | ||
let stats | ||
let stats = [] | ||
let statsOutput = '' | ||
if (gameId && !rounds.unlimited) { | ||
stats = `worlde #${gameId} ${rounds.currentRound}/${rounds.rounds}` | ||
} else if (gameId) { | ||
stats = ` worlde #${gameId} ` | ||
} else if (!rounds.unlimited) { | ||
stats = ` worlde ${rounds.currentRound}/${rounds.rounds} ` | ||
} else { | ||
stats = ` ` | ||
} | ||
if (gameId) stats.push(`#${gameId}`) | ||
if (!rounds.unlimited) stats.push(`${rounds.currentRound}/${rounds.rounds}`) | ||
if (stats.length) statsOutput = `wordle ${stats.join(' ')}` | ||
const statsPadding = (23 - statsOutput.length) / 2 | ||
statsOutput = insertSpaces(Math.ceil(statsPadding)) + statsOutput + insertSpaces(Math.floor(statsPadding)) | ||
console.log(` | ||
@@ -36,3 +38,3 @@ _____________________________ | ||
\\_| CONGRATULATIONS | | ||
| ${stats} | | ||
| ${statsOutput} | | ||
| | | ||
@@ -39,0 +41,0 @@ | \x1b[33m ___________ \x1b[0m | |
{ | ||
"name": "wordle-cli", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "CLI interpretation of the game Wordle", | ||
@@ -5,0 +5,0 @@ "main": "bin/index.js", |
154338
9
13261