const generator = require("project-name-generator");

let firstSubject = generator.generate().spaced;
let secondSubject = generator.generate({ words: 2, alliterative: true }).spaced;

let pre = ["My Year of","A Guide To","Simply","A Cook's Guide to","The Book of","A tale of","To","A","The","The","The","One","Beginning","My","A Manual of","",""];
let connector = [" of"," for"," for"," with"," and"," on",":",": on"," OR"];
let choose = arr => arr[Math.floor(Math.random()*arr.length)];

let book;

if (Math.random()<0.4){
  book = choose(pre) + " " + firstSubject + choose(connector) + " " + secondSubject;
} else if (Math.random()<0.5){
  book = choose(pre) + " " + firstSubject;
} else {
  book = choose(pre) + " " + secondSubject;
}

console.log(book);
