mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 15:58:06 +02:00
Fix
This commit is contained in:
@@ -26,6 +26,7 @@ module.exports = class AnagramicaCommand extends Command {
|
|||||||
key: 'time',
|
key: 'time',
|
||||||
prompt: 'How long should the game last in seconds? Max 90, min 15.',
|
prompt: 'How long should the game last in seconds? Max 90, min 15.',
|
||||||
type: 'integer',
|
type: 'integer',
|
||||||
|
default: 45,
|
||||||
max: 90,
|
max: 90,
|
||||||
min: 15
|
min: 15
|
||||||
}
|
}
|
||||||
@@ -75,7 +76,7 @@ module.exports = class AnagramicaCommand extends Command {
|
|||||||
getScore(letters, word) {
|
getScore(letters, word) {
|
||||||
let score = 0;
|
let score = 0;
|
||||||
for (const letter of word.split('')) {
|
for (const letter of word.split('')) {
|
||||||
if (!letters[letter]) return null;
|
if (!letters.includes(letter)) return null;
|
||||||
score += scores[letter];
|
score += scores[letter];
|
||||||
}
|
}
|
||||||
return score;
|
return score;
|
||||||
|
|||||||
Reference in New Issue
Block a user