(function()
{
    "use strict";

    var R = require('ramda');
    var w = require('./get-word');
    var mail = require('./sendmail');

    // custom R functions
    var r = {};

    // make function that tests if a word contains a character
    r.strContains = R.curry(function(ch, word)
    {
        return R.strIndexOf(ch, word) >= 0;
    });

    // create random function
    r.random = function(n)
    {
        return Math.floor(Math.random() * n);
    };

    // load the words array
    var words = w.getWords();

    // make function to test if a word os a particular length
    var isLengthN = R.curry(function(n, w)
    {
        return w.length === n;
    });

    var isLength3 = isLengthN(3);

    // test for j,k, q, x & z
    var hasValuableChar = R.anyPredicates([r.strContains('j'), r.strContains('k'), r.strContains('q'), r.strContains('x'), r.strContains('z')  ]);

    // also test for no vowel
    var hasAVowel = R.anyPredicates([r.strContains('a'), r.strContains('e'), r.strContains('i'), r.strContains('o'), r.strContains('u')  ]);
    var hasNoVowel = R.not(hasAVowel);

    // want 3-letter words with a valuable character, or no vowel
    var pick = R.and(isLength3, R.or(hasValuableChar, hasNoVowel));

    // get short valuable words
    var w3valuable = R.filter(pick, words);

    // dump all
    // console.log(w3valuable);
    // console.log(w3valuable.length);

    // pick one at random
    var word = w3valuable[r.random(w3valuable.length)];

    console.log(word);

    mail.send(process.env.mailFrom, process.env.mailTo, 'Word of the day: ' + word, word);

}());

@@ -925,24 +925,25 @@
 ar hasAVowel
+y
  = R.anyPred
@@ -1048,16 +1048,36 @@
 ins('u')
+, r.strContains('y')
   %5D);%0A  
@@ -1092,16 +1092,17 @@
 sNoVowel
+y
  = R.not
@@ -1111,16 +1111,17 @@
 asAVowel
+y
 );%0A%0A    
@@ -1174,32 +1174,32 @@
 er, or no vowel%0A
-
     var pick = R
@@ -1246,16 +1246,17 @@
 sNoVowel
+y
 ));%0A%0A   

Make y a vowel