Commit dfaece2b authored by Aral Balkan's avatar Aral Balkan

Overcoming CoffeeScript syntax brain freeze.

parent 69956796
......@@ -29,7 +29,7 @@ hhgttg = JSON.parse fs.readFileSync 'all-unique-words-in-the-hitchhikers-guide.j
hhgttgPicker = new Picker hhgttg
# Words in hhgttg that might be insenstive especially when combined with another random word.
wordsToAvoid = {'mongoloid': true, 'buggering': true, 'cock': true, 'stupid': true, 'fingering': true}
wordsToAvoid = ['mongoloid', 'buggering', 'cock', 'stupid', 'fingering']
#
# Implementation of hash sieve algorithm that I read
......@@ -78,8 +78,7 @@ generateCodes = (fromId, toId) ->
numAvoidedWords = 0
pickWord = ->
word = hhgttgPicker.pick().toLowerCase()
if wordsToAvoid[word]
# console.log "Avoiding word #{word}…"
if word in wordsToAvoid
numAvoidedWords++
word = pickWord()
return word
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment