#!/usr/bin/env node 'use strict'; var program = require('commander'); program .version('0.0.1') .option('-n, --number ', 'Number of food names', parseInt) .parse(process.argv); program .on('*', function (name) { console.log('\'' + name + '\' is not a known command. See \'foody --help\':'); program.outputHelp(); process.exit(1); }); program .parse(process.argv); if (program.args.length < 1) { if(program.number === 0){ console.log('Zero? Are you kidding me?'); } var __raw = generate(program.number || 1); var __names = verify(__raw); __names.forEach(function (name) { console.log(name); }); process.exit(0); } function generate(n) { var src = [ ['Baked', 'Barbecued', 'Basted', 'Blanched', 'Braised', 'Breaded', 'Brined', 'Broasted', 'Cooked', 'Cured', 'Deep-Fried', 'Dried', 'Dry-Roasted', 'Engine-Cooked', 'Fire-Grilled', 'Fire-Roasted', 'Fried', 'Gentle-Fried', 'Grilled', 'Infused', 'Marinated', 'Oven-Baked', 'Oven-Grilled', 'Pan-Fried', 'Pickled', 'Poached', 'Pressure-Cooked', 'Pressure-Fried', 'Roasted', 'Sautéed', 'Seared', 'Shallow-Fried', 'Simmered', 'Slow-Cooked', 'Smoked', 'Steamed', 'Stewed', 'Stir-Fried', 'Stuffed', 'Tea-Smoked', 'Tenderized', 'Thermal-Cooked'], ['Almonds & Avocado', 'Apple & Lavender', 'Apples & Mustard', 'Apples & Walnut', 'Apricot & Basil', 'Apricots & Honey', 'Aspargus', 'Basil & Cinnamon', 'Basil & Clove', 'Basil & Lime', 'Basil & Mint', 'Beets & Lemon', 'Beets & Orange', 'Bittersweet', 'Black Pepper', 'Blackberry & Ginger', 'Blueberry', 'Blueberry & Mushroom', 'Butter', 'Carrot & Corriander', 'Carrot & Violet', 'Potatoes &', 'Rice &', 'Pasta & ', 'Carrots & Ginger', 'Casserole of', 'Cheese &', 'Chestnuts &', 'Chilli', 'Cinnamon', 'Cinnamon & Thyme', 'Cocoa & Mushroom', 'Coconut', 'Coconut & Ginger', 'Confit of', 'Coriander & Lemon', 'Cranberry', 'Creamy', 'Cucumber &', 'Cucumber & Lime', 'Curry of', 'Dark Ale', 'Dark Beer', 'Easter-Style', 'Egg & Beans', 'Egg & Beet', 'Egg & Coconut', 'Fennel', 'Fennel & Garlic', 'Fennel & Lemon', 'Fennel & Lime', 'Fennel & Orange', 'Figs & Olive', 'Forest', 'Garlic', 'Garlic & Ginger', 'Garlic & Lime', 'Garlic & Onion', 'Garlic & Rosemary', 'Garlic & Tomato', 'Ginger', 'Ginger & Honey', 'Hazelnut', 'Herbs &', 'Honey', 'Honey & Almond', 'Honey & Nuts', 'Honey & Thyme', 'Honey-Coated', 'Hot & Spicy', 'Hot & Sweet', 'Jasmine', 'Juniper', 'Lemon', 'Lemongrass', 'Light Ale', 'Light Beer', 'Lime', 'Lime & Ginger', 'Lime-Coated', 'Mango & Pine', 'Mint', 'Mint & Berry', 'Mint & Mustard', 'Mint & Orange', 'Mountain', 'Mushroom', 'Mushroom & Apricot', 'Mushroom & Garlic', 'Mushroom & Rosemary', 'Mustard', 'Mustard & Garlic', 'Mustard & Rosemary', 'Mustard & Thyme', 'Northern-Style', 'Nuts &', 'Olive', 'Olives & Mustard', 'Onions & Cream', 'Onions & Tomato', 'Orange', 'Orange & Mustard', 'Orange & Olive', 'Oregano', 'Paprika', 'Parmesan', 'Parsnip & Pear', 'Peach & Vinegar', 'Peanuts &', 'Peas & Mushroom', 'Pepper', 'Pepper & Garlic', 'Pepper & Lime', 'Pepper & Mango', 'Peppermint', 'Pine', 'Pineapple', 'Raspberry & Peanut', 'Red Whine', 'Rhubarb', 'Rosemary', 'Rosemary & Onion', 'Saffron', 'Saffron & Shallot', 'Salt & Pepper', 'Salt & Savory', 'Salted', 'Salty & Sour', 'Savory', 'Sour', 'Sour & Cream', 'Souther-Style', 'Soy', 'Stew of', 'Sugar', 'Sweet & Fresh', 'Sweet & Savory', 'Sweet & Spicy', 'Sweet \'n Sour', 'Thyme & Parsley', 'Tomatos &', 'Truffles &', 'Vanilla', 'Vanilla & Mint', 'Vegetables &', 'Vinegar', 'Walnuts &', 'Wasabi', 'Watercress', 'Western-Style', 'White Wine', 'Yogurt'], ['Bear', 'Beef', 'Boar', 'Chicken', 'Duck', 'Horse', 'Lamb', 'Mammoth', 'Mutton', 'Ostrich', 'Pheasant', 'Pigeon', 'Pork', 'Quail', 'Rabbit', 'Turkey', 'Venison', 'Yak'], ['Clams', 'Cockles', 'Cod', 'Crab', 'Crocodile', 'Alligator', 'Fish', 'Frog', 'Herring', 'Lobster', 'Mussels', 'Oysters', 'Prawns', 'Salmon', 'Scallops', 'Shrimps', 'Snapper', 'Trout', 'Tuna'], ['Bake', 'Bread', 'Bruschetta', 'Buns', 'Calzone', 'Chestnuts', 'Chutney', 'Flatbread', 'Forest Mushrooms', 'Gratin', 'Kebabs', 'Lasagne', 'Linguine', 'Moussaka', 'Nut Mix', 'Omelette', 'Pasta', 'Pie', 'Pizza', 'Potato Wedges', 'Potatoes', 'Rice', 'Risotto', 'Roll', 'Salad', 'Sandwich', 'Scrambled Egg', 'Soup', 'Spring Greens', 'Spring Vegetables', 'Stuffed Bread', 'Taco', 'Tart', 'Tofu', 'Tortilla', 'Vegetable Mix', 'Vegetables', 'Walnuts', 'Winter Greens', 'Winter Vegetables'], ['Almond', 'Apple', 'Avocado', 'Banana', 'Blueberry', 'Caramel', 'Cardamom', 'Cashew', 'Cherry', 'Chestnut', 'Chocolate', 'Cinnamon', 'Cocoa', 'Coconut', 'Coffee', 'Cranberry', 'Dark Chocolate', 'Date', 'Elderberry', 'Ginger', 'Gooseberry', 'Grape', 'Grapefruit', 'Guava', 'Hazelnut', 'Honey', 'Kiwi', 'Lemon', 'Licorice', 'Lime', 'Mandarin', 'Mango', 'Melon', 'Milk Chocolate', 'Mint', 'Nutmeg', 'Orange', 'Papaya', 'Passion Fruit', 'Peach', 'Peanut', 'Pecan', 'Pineapple', 'Pistachio', 'Plum', 'Praline', 'Raspberry', 'Red Wine', 'Rum', 'Saffron', 'Strawberry', 'Vanilla', 'Walnut', 'White Chocolate', 'White Wine'], ['Bombe', 'Bonbons', 'Bread', 'Buns', 'Cake', 'Candy', 'Cheesecake', 'Cobbler', 'Cone', 'Cookies', 'Crispies', 'Crumble', 'Custard', 'Delight', 'Doughnut', 'Fruit Salad', 'Fruitcake', 'Fudge', 'Genoise', 'Gingerbread', 'Ice Cream', 'Ice Lollies', 'Jam', 'Jelly', 'Milk', 'Molten Cake', 'Mooncake', 'Pancakes', 'Pastry', 'Pavlova', 'Pie', 'Pound Cake', 'Pud', 'Pudding', 'Roll', 'Snacks', 'Sorbet', 'Soufflé', 'Split', 'Steamed Pudding', 'Strudel', 'Sundae', 'Surprise', 'Tart', 'Tarte Tatin', 'Toast', 'Toffee', 'Trifle', 'Wafer', 'Waffles', 'Whip', 'Yogurt'] ]; var __random = []; var __names = []; var __name = ''; for (var i = 0; i < n; i++) { if (Math.floor(Math.random() * 10) % 2 === 0) { __random[0] = Math.floor(Math.random() * src[0].length); __random[1] = Math.floor(Math.random() * src[1].length); if (i < 2) { __random[2] = Math.floor(Math.random() * src[2].length); __name = src[0][__random[0]] + ' ' + src[1][__random[1]] + ' ' + src[2][__random[2]]; } else if (i < 4) { __random[2] = Math.floor(Math.random() * src[3].length); __name = src[0][__random[0]] + ' ' + src[1][__random[1]] + ' ' + src[3][__random[2]]; } else { __random[2] = Math.floor(Math.random() * src[4].length); __name = src[0][__random[0]] + ' ' + src[1][__random[1]] + ' ' + src[4][__random[2]]; } } else { __random[0] = Math.floor(Math.random() * src[5].length); __random[1] = Math.floor(Math.random() * src[6].length); if (i < 8) { __random[2] = Math.floor(Math.random() * src[5].length); while (__random[2] === __random[0]) { __random[2] = Math.floor(Math.random() * src[5].length); } __name = src[5][__random[0]] + ' and ' + src[5][__random[2]] + ' ' + src[6][__random[1]]; } else { __name = src[5][__random[0]] + ' ' + src[6][__random[1]]; } } __names.push(__name); } return __names; } function clean(arr) { for (var i = 0; i < arr.length; i++) { for (var j = 0; j < arr.length; j++) { if (i != j) { if (arr[i] == arr[j]) { delete arr[i]; } } } } return arr; } function verify(arr){ var __clean = clean(arr); if(arr.length !== __clean.length){ __clean.concat(generate(arr.length - __clean.length)); return verify(__clean); } else{ return __clean; } }