Skip to content

Instantly share code, notes, and snippets.

@devrsantos
Created February 23, 2022 18:53
Show Gist options
  • Save devrsantos/4298687eba1377c7e52494ecae556314 to your computer and use it in GitHub Desktop.
Save devrsantos/4298687eba1377c7e52494ecae556314 to your computer and use it in GitHub Desktop.
let lista_de_pratos = ["pipoca", "macarrão", "carne", "feijão", "brigadeiro"];
function entrada(item, time) {
if (lista_de_pratos.includes(item)) {
if (item == 'pipoca') {
if (time >= 10 && time < 20) {
if(time >= 11 && time < 20 ) {
console.log('CUIDADO PRATO MUITO QUENTE!!!!');
}
console.log('prato pronto bom apetite')
}
if (time >= 20 && time < 30) {
if(time >= 21 && time < 30 ) {
console.log('NÃO SABE USAR UM MICROONDAS!!!!');
}
console.log('prato queimou')
}
if (time >= 30 && time < 400) {
if(time >= 31 && time < 400 ) {
console.log('LIGUE PARA O BOMBEIRO - 193!!!!');
} else {
console.log('KABUUMMMM')
}
}
if (time < 10) {
console.log('tempo insuficiente')
}
}
if (item == 'macarrão') {
if (time >= 8 && time < 16) {
if(time >= 9 && time < 16 ) {
console.log('CUIDADO PRATO MUITO QUENTE!!!!');
}
console.log('prato pronto bom apetite')
}
if (time >= 16 && time < 24) {
if(time >= 17 && time < 24 ) {
console.log('NÃO SABE USAR UM MICROONDAS!!!!');
}
console.log('prato queimou')
}
if (time >= 24 && time < 400) {
if(time >= 25 && time < 400 ) {
console.log('LIGUE PARA O BOMBEIRO - 193!!!!');
} else {
console.log('KABUUMMMM')
}
}
if (time < 8) {
console.log('tempo insuficiente')
}
}
if (item == 'carne') {
if (time >= 10 && time < 20) {
if(time >= 11 && time < 20 ) {
console.log('CUIDADO PRATO MUITO QUENTE!!!!');
}
console.log('prato pronto bom apetite')
}
if (time >= 20 && time < 30) {
if(time >= 21 && time < 30 ) {
console.log('NÃO SABE USAR UM MICROONDAS!!!!');
}
console.log('prato queimou')
}
if (time >= 30 && time < 400) {
if(time >= 31 && time < 400 ) {
console.log('LIGUE PARA O BOMBEIRO - 193!!!!');
} else {
console.log('KABUUMMMM')
}
}
if (time < 10) {
console.log('tempo insuficiente')
}
}
if (item == 'feijão') {
if (time >= 10 && time < 20) {
if(time >= 11 && time < 20 ) {
console.log('CUIDADO PRATO MUITO QUENTE!!!!');
}
console.log('prato pronto bom apetite')
}
if (time >= 20 && time < 30) {
if(time >= 21 && time < 30 ) {
console.log('NÃO SABE USAR UM MICROONDAS!!!!');
}
console.log('prato queimou')
}
if (time >= 30 && time < 400) {
if(time >= 31 && time < 400 ) {
console.log('LIGUE PARA O BOMBEIRO - 193!!!!');
} else {
console.log('KABUUMMMM')
}
}
if (time < 10) {
console.log('tempo insuficiente')
}
}
if (item == 'brigadeiro') {
if (time >= 10 && time < 20) {
if(time >= 11 && time < 20 ) {
console.log('CUIDADO PRATO MUITO QUENTE!!!!');
}
console.log('prato pronto bom apetite')
}
if (time >= 20 && time < 30) {
if(time >= 21 && time < 30 ) {
console.log('NÃO SABE USAR UM MICROONDAS!!!!');
}
console.log('prato queimou')
}
if (time >= 30 && time < 400) {
if(time >= 31 && time < 400 ) {
console.log('LIGUE PARA O BOMBEIRO - 193!!!!');
} else {
console.log('KABUUMMMM')
}
}
if (time < 10) {
console.log('tempo insuficiente')
}
}
} else {
console.log("Prato inexistente");
}
}
entrada('macarrão', 44);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment