{ "cells": [ { "cell_type": "markdown", "id": "66f72396-0cf1-41cf-a486-2930d2ad1652", "metadata": {}, "source": [ "# cocktail_generator\n", "randomly chooses ingredients from a menu for a nice cocktail recipe" ] }, { "cell_type": "code", "execution_count": 1, "id": "9bd8860a-9967-49d5-a74a-b5de669dfe6d", "metadata": {}, "outputs": [], "source": [ "def cocktail_generator(alcohol: list, decor: list) -> str:\n", " \"\"\"randomly chooses ingredients from a menu for a nice cocktail recipe\"\"\"\n", "\n", " import datetime\n", " from datetime import timedelta\n", " now = datetime.datetime.now() + timedelta(hours=1) \n", " from random import choice\n", "\n", " base = [\"ORANGE JUICE\", \"PINEAPPLE JUICE\", \"APPLE JUICE\", \"MANGO JUICE\", \"FRIZZY WATER\", \"GRAPEFRUIT JUICE\", \"TONIC WATER\"]\n", "\n", " sour = [\"LEMON JUICE\", \"LIME JUICE\", \"PASSION FRUIT\"]\n", "\n", " sweet = [\"AGAVE SIRUP\", \"SUGAR SIRUP\", \"MAPLE SIRUP\"]\n", "\n", " omph = [\"1 SLICE GINGER\", \"2 LEAVES MINT\", \"1 SLICE CUCUMBER\", \"1 STICK CINNAMON\", \" SALT RIM\"] \n", "\n", "\n", " snack = [\"CHIPS\", \"SALTED CORN\", \"PRETZELS\", \"SALTED NUTS\"]\n", "\n", "\n", " XPUB1 = [\" (*(*(*(*(*.(*.*).*)*)*)*)*)*)\", \" (^(^(^(^(^.(^.^).^)^)^)^)^)^)\"]\n", "\n", "\n", " drink = [\"\"\"\n", " ___, \n", " '._.'\\ \n", " _____/'-.\\ \n", " | / | \n", " |~~~/~~| \n", " \\ () / \n", " '.__.' \n", " || \n", " _||_ \n", " `----` \"\"\", \"\"\"\n", " .\n", " . . \n", " |^ .\n", " \\O___.____ /\n", " \\ . /\n", " \\ ,/\n", " []\n", " []\n", " []\n", " -------- \n", " \"\"\", \"\"\"\n", " \\ \n", " .-\\\"\"\"\"\"\"\"\"-.\n", " \\ \\__ o . /\n", " \\/ \\ o/\n", " \\__/. /\n", " \\_ _/\n", " Y\n", " |\n", " _.-' '-._\n", " `---------` \"\"\"]\n", "\n", " \n", "\n", "\n", " recipe = f\"\"\"\n", "
\n",
    "    \n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "*                             *\n",
    "*   CATWALKING WITH ALCOHOL   *\n",
    "*                             *\n",
    "*    {now.strftime(\"%Y-%m-%d   %H:%M:%S\")}    *\n",
    "*                             *\n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "\n",
    "\n",
    "\n",
    "2 oz          {choice(alcohol)}\n",
    "\n",
    "150 ml        {choice(base)}\n",
    "\n",
    "1 oz          {choice(sour)}\n",
    "\n",
    "0.5 oz        {choice(sweet)}\n",
    "\n",
    "{choice(omph)}\n",
    "\n",
    "1             {choice(decor)}\n",
    "\n",
    "\n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "\n",
    "EXTRA: {choice(snack)}\n",
    "\n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "\n",
    "\n",
    "           ___, \n",
    "          '._.'\\ \n",
    "       _____/'-.\\ \n",
    "      |    / | \n",
    "      |~~~/~~| \n",
    "      \\ ()   / \n",
    "       '.__.' \n",
    "         || \n",
    "        _||_ \n",
    "       `----` \n",
    "\n",
    "\n",
    "THANKS FOR COMING TO OUR LAUNCH!\n",
    "\n",
    "{choice(XPUB1)}\n",
    "\n",
    "\n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
    "\n",
    "
\n", " \"\"\"\n", " \n", "\n", "\n", " return recipe" ] }, { "cell_type": "markdown", "id": "d50511cb-a810-4fe1-a681-e5cb1392c0d0", "metadata": {}, "source": [ "![cocktail_generator](https://hub.xpub.nl/soupboat/~chae/vernacular-cocktail.jpg)" ] }, { "cell_type": "markdown", "id": "1094ed8e-1387-481e-b612-9a8cc81d5c18", "metadata": {}, "source": [ "This function generates amazing cocktail recipes for you to try! The cocktail menu includes the categories alcohol, base, sour, sweet and omph. There is also a category for a decorative gadget and one for an extra snack. Each category has a default list of ingredients and the function randomly chooses one ingredient per category. You prefer Rum and Tequila over Vodka? Or maybe you want a non-alcoholic cocktail? DonĀ“t worry! For the categories alcohol and decor you can insert your own ingredients to pick from. Enjoy!\n", "\n", " Menu:\n", "\n", " default ingredients:\n", " base = ORANGE JUICE, PINEAPPLE JUICE, APPLE JUICE, MANGO JUICE, FRIZZY WATER, GRAPEFRUIT JUICE, TONIC WATER\n", " sour = LEMON JUICE, LIME JUICE, PASSION FRUIT\n", " sweet = AGAVE SIRUP, SUGAR SIRUP, MAPLE SIRUP\n", " omph = 1 SLICE GINGER, 2 LEAVES MINT, 1 SLICE CUCUMBER, 1 STICK CINNAMON, SALT RIM \n", " snack = CHIPS, SALTED CORN, PRETZELS, SALTED NUTS\n", "\n", " users ingredients:\n", " alcohol =\n", " decor =\n" ] }, { "cell_type": "markdown", "id": "2c3e992a-317b-4433-8c3b-9efcedea575d", "metadata": { "tags": [] }, "source": [ "## Examples\n", "\n", "In this exmaple the function chooses between three alcoholic ingredients and two decoratin gadgets" ] }, { "cell_type": "code", "execution_count": 3, "id": "e3d7e97b-0089-4c29-a2c1-9ef823ff2e37", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "
\n",
      "    \n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "*                             *\n",
      "*   CATWALKING WITH ALCOHOL   *\n",
      "*                             *\n",
      "*    2021-12-14   14:08:04    *\n",
      "*                             *\n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "\n",
      "\n",
      "\n",
      "2 oz          VODKA\n",
      "\n",
      "150 ml        GRAPEFRUIT JUICE\n",
      "\n",
      "1 oz          LEMON JUICE\n",
      "\n",
      "0.5 oz        SUGAR SIRUP\n",
      "\n",
      "1 SLICE       CUCUMBER\n",
      "\n",
      "1             UMBRELLA\n",
      "\n",
      "\n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "\n",
      "EXTRA: SALTED CORN\n",
      "\n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "\n",
      "\n",
      "           ___, \n",
      "          '._.'\\ \n",
      "       _____/'-.\\ \n",
      "      |    / | \n",
      "      |~~~/~~| \n",
      "      \\ ()   / \n",
      "       '.__.' \n",
      "         || \n",
      "        _||_ \n",
      "       `----` \n",
      "\n",
      "\n",
      "THANKS FOR COMING TO OUR LAUNCH!\n",
      "\n",
      " (^(^(^(^(^.(^.^).^)^)^)^)^)^)\n",
      "\n",
      "\n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n",
      "\n",
      "
\n", " \n" ] } ], "source": [ "print(cocktail_generator(['VODKA', 'TEQUILA', 'RUM'], ['UMBRELLA', 'PALMTREE', 'FLAMINGO']))" ] }, { "cell_type": "code", "execution_count": null, "id": "6e79116b-12d7-4b6e-a764-f7a8fc14c1ce", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 5 }