{"version":3,"sources":["jsdelivr-header.js","/npm/rzgame@1.1.2/app.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;OCLO,aAAc,kBACd,UAAW,eACX,mBAAoB,yBACpB,cAAe,qBACtB,QAAQ,QACR,MAAM,MAAQ,IACH,IAAI,SAAS,IAChB,WAAW,EAAK,IAAK,IAG7B,eAAe,SACX,MAAM,EAAQ,eAAe,QAAQ,gDAC/B,QACN,EAAM,MACV,CACA,IAAI,SAAW,EACf,eAAe,YACX,IAAI,EAAgB,KAAK,MAAsB,GAAhB,KAAK,SAAgB,GACpD,EAAG,CACC,WACA,QAAQ,IAAI,8BAA8B,YAC1C,IAAI,QAAe,SAAS,OAAO,CAC/B,CACI,KAAM,QACN,KAAM,YACN,QAAS,MAAM,OAAO,wCACtB,SAAU,aAGd,OAAO,EAAO,aAAe,EAC7B,QAAQ,IAAI,MAAM,IAAI,IAAK,IAAK,IAApB,CAAyB,gBAAgB,MAAM,aAAa,+BAEnE,EAAO,UAAY,EACxB,QAAQ,IAAI,eAAe,EAAO,2BAE7B,EAAO,UAAY,EACxB,QAAQ,IAAI,cAAc,EAAO,2BAGjC,QAAQ,IAAI,kBAEpB,OAAS,SAAW,GAAK,IAAkB,OAAO,EAAO,YACzC,GAAZ,UACA,QAAQ,IAAI,MAAM,KAAK,oBAE/B,CACA,eAAe,YACX,EAAG,OACO,eACA,YACN,QAAQ,IAAI,UACZ,IAAI,QAAkB,SAAS,OAAO,CAClC,CACI,KAAM,UACN,KAAM,UACN,QAAS,gCACT,SAAS,IAGrB,OAA8B,GAArB,EAAU,eAAwB,YAC/C,CACA","file":"/npm/rzgame@1.1.2/app.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/rzgame@1.1.2/app.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#! /usr/bin/env node\nimport inquirer from \"inquirer\";\nimport chalk from \"chalk\";\nimport chalkAnimation from \"chalk-animation\";\nimport validator from \"./src/validator.js\";\nconsole.clear();\nconst sleep = () => {\n    return new Promise((res) => {\n        setTimeout(res, 2000);\n    });\n};\nasync function header() {\n    const title = chalkAnimation.rainbow(`Welcome dear, in number guessing game!`);\n    await sleep();\n    title.stop();\n}\nlet attempts = 3;\nasync function userInput() {\n    let computerInput = Math.floor(Math.random() * 10 + 1);\n    do {\n        attempts--;\n        console.log(`\\nNo of attempts remaining ${attempts}`);\n        var answer = await inquirer.prompt([\n            {\n                type: \"input\",\n                name: \"userGuess\",\n                message: chalk.yellow(\"🤔 Guess the number between 1 & 10 :\"),\n                validate: validator,\n            },\n        ]);\n        if (Number(answer.userGuess) === computerInput) {\n            console.log(chalk.rgb(255, 100, 255)(`💕💕💕 Bravo ${chalk.yellowBright(\"you win\")}🎉🎉🎉 the game.`));\n        }\n        else if (answer.userGuess > computerInput) {\n            console.log(`Your guess  ${answer.userGuess} is greater 💻`);\n        }\n        else if (answer.userGuess < computerInput) {\n            console.log(`Your guess ${answer.userGuess} is smaller 💻`);\n        }\n        else {\n            console.log(\"Sorry try again\");\n        }\n    } while (attempts > 0 && computerInput !== Number(answer.userGuess));\n    if (attempts == 0) {\n        console.log(chalk.blue(\"👽👽👽 Game Over\"));\n    }\n}\nasync function playAgain() {\n    do {\n        await header();\n        await userInput();\n        console.log(attempts);\n        var selection = await inquirer.prompt([\n            {\n                type: \"confirm\",\n                name: \"restart\",\n                message: \"Do you want to play again ?: \",\n                default: false,\n            },\n        ]);\n    } while (selection.restart == true ? await userInput() : false);\n}\nplayAgain();\n"]}