mirror of
https://github.com/quantum5/correcthorsebatterystaple.git
synced 2025-04-24 10:11:57 -04:00
Add medium word list.
This commit is contained in:
parent
492f29d4a0
commit
04dbed2c11
|
@ -3,7 +3,7 @@ const digits = '0123456789'
|
||||||
const symbols = '`~!@#$%^&*()_+-=,./<>?;:|'
|
const symbols = '`~!@#$%^&*()_+-=,./<>?;:|'
|
||||||
|
|
||||||
function getWordList (name) {
|
function getWordList (name) {
|
||||||
if (['small'].includes(name)) {
|
if (['small', 'medium'].includes(name)) {
|
||||||
return words[name]
|
return words[name]
|
||||||
}
|
}
|
||||||
throw new Error(`Invalid word list: ${name}`)
|
throw new Error(`Invalid word list: ${name}`)
|
||||||
|
@ -59,3 +59,7 @@ function computeBits (options) {
|
||||||
|
|
||||||
return wordBits * options.count + capsBits + symbolBits + digitBits
|
return wordBits * options.count + capsBits + symbolBits + digitBits
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
getWordList, getWords, capitalize, generate, lengthBits, computeBits
|
||||||
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="word-list" class="form-control custom-select" name="list">
|
<select id="word-list" class="form-control custom-select" name="list">
|
||||||
<option value="small">2048 words (11 bits/word)</option>
|
<option value="small">2048 words (11 bits/word)</option>
|
||||||
<option value="medium" disabled>4096 words (12 bits/word)</option>
|
<option value="medium">4096 words (12 bits/word)</option>
|
||||||
<option value="large" disabled>8192 words (13 bits/word)</option>
|
<option value="large" disabled>8192 words (13 bits/word)</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -521,7 +521,6 @@ module.exports = [
|
||||||
'dreadful',
|
'dreadful',
|
||||||
'dream',
|
'dream',
|
||||||
'dress',
|
'dress',
|
||||||
'drew',
|
|
||||||
'drink',
|
'drink',
|
||||||
'drive',
|
'drive',
|
||||||
'drop',
|
'drop',
|
||||||
|
@ -696,7 +695,6 @@ module.exports = [
|
||||||
'flat',
|
'flat',
|
||||||
'fleet',
|
'fleet',
|
||||||
'flesh',
|
'flesh',
|
||||||
'flew',
|
|
||||||
'flight',
|
'flight',
|
||||||
'flood',
|
'flood',
|
||||||
'floor',
|
'floor',
|
||||||
|
@ -790,6 +788,7 @@ module.exports = [
|
||||||
'governor',
|
'governor',
|
||||||
'grace',
|
'grace',
|
||||||
'gracious',
|
'gracious',
|
||||||
|
'grade',
|
||||||
'grain',
|
'grain',
|
||||||
'grant',
|
'grant',
|
||||||
'grasp',
|
'grasp',
|
||||||
|
@ -801,7 +800,6 @@ module.exports = [
|
||||||
'great',
|
'great',
|
||||||
'greek',
|
'greek',
|
||||||
'green',
|
'green',
|
||||||
'grew',
|
|
||||||
'grey',
|
'grey',
|
||||||
'grief',
|
'grief',
|
||||||
'gross',
|
'gross',
|
||||||
|
@ -1091,6 +1089,7 @@ module.exports = [
|
||||||
'medium',
|
'medium',
|
||||||
'meet',
|
'meet',
|
||||||
'melancholy',
|
'melancholy',
|
||||||
|
'melt',
|
||||||
'member',
|
'member',
|
||||||
'memory',
|
'memory',
|
||||||
'mental',
|
'mental',
|
||||||
|
@ -1844,6 +1843,7 @@ module.exports = [
|
||||||
'thunder',
|
'thunder',
|
||||||
'thus',
|
'thus',
|
||||||
'tide',
|
'tide',
|
||||||
|
'tilde',
|
||||||
'till',
|
'till',
|
||||||
'time',
|
'time',
|
||||||
'tiny',
|
'tiny',
|
||||||
|
|
2050
src/words/4096.js
Normal file
2050
src/words/4096.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,4 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
small: require('./2048')
|
small: require('./2048'),
|
||||||
|
medium: require('./4096'),
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,11 @@ const assert = require('assert').strict
|
||||||
const words = require('../src/words')
|
const words = require('../src/words')
|
||||||
|
|
||||||
describe('Word List Tests', () => {
|
describe('Word List Tests', () => {
|
||||||
const lists = ['small']
|
const lists = ['small', 'medium']
|
||||||
|
|
||||||
it('length', () => {
|
it('length', () => {
|
||||||
assert.equal(words.small.length, 2048, 'small list size incorrect')
|
assert.equal(words.small.length, 2048, 'small list size incorrect')
|
||||||
|
assert.equal(words.medium.length, 4096, 'medium list size incorrect')
|
||||||
})
|
})
|
||||||
|
|
||||||
lists.forEach(name => {
|
lists.forEach(name => {
|
||||||
|
|
Loading…
Reference in a new issue