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