Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 16.72 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. using System.Collections.Generic;
  4.  
  5. class TrabIA_RecomendacaoFilme
  6. {
  7.   static Queue<char> indicadorRespostas = new Queue<char>();
  8.  
  9.   static string[] papoFuradoInicio = {"Talvez você", "Quem sabe tu", "Acho que você", "Acho que tu", "Você", "Tu", "As vezes você", "As vezes tu"};
  10.  
  11.   static string[] papoFuradoFinal = {", né?", ", sera?", ", to achando que sim...", ", talvez não..."}; //não pensei em mais papo furado para o fim
  12.  
  13.   static string[] papoFuradoDecisao = {"Ok, deixe-me ver que filmes vão te interessar", "Deixa eu procurar o melhor filme para você baseado nessas escolhas", "To procurando o filme perfeito pra você baseado no que escolheu", "Sera que você vai gostar mais desse aqui, ou deste ali"};
  14.  
  15.   static string[] perguntasTerror = {"Prefere os filmes de terror atuais", "Gosta de terror de ficção fantasia", "Gosta de terror de ficção cientifica"};
  16.   static string[] filmesDeTerror = {"Morto não Fala", "Fenomenos Paranormais", "Historias alem do tumulo", "O sexto sentido", "Navio Fantasma", "O iluminado", "Aniquilação", "Um Lugar Silencioso", "Alien Covenant", "Pandorum", "O Enigma de Outro Mundo", "Eles Vivem"};
  17.  
  18.   static string[] perguntasComedia = {"Prefere os filmes de comédia nacionais", "Prefere os filmes atuais de comédia", "Gosta de ver filmes de comédia romantica", "Gostaria de ver filmes de humor negro", "Gostaria de ver filmes de sátira", "Gostaria de ver filmes de comédia de terror"};
  19.   static string[] filmesDeComedia = {"O Homem Perfeito", "Minha Vida em Marte", "De Onde Eu Te Vejo","Lisbela e o Prisioneiro", "Houve uma Vez Dois Verões", "A Dona da História", "Zoom", "TOC Transtornada Obsessiva Compulsiva", "A Comédia Divina", "O auto da Compadecida", "Saneamento Básico o filme", "Memórias Póstumas", "Linda de Morrer", "Bingo: O Rei das Manhãs", "Antes Que Eu Me Esqueça", "Meu tio matou um cara", "Confissões de Adolescente", "O Cheiro do Ralo", "Quando Eu Era Vivo", "Mar Negro", "O Lobo Atrás da Porta", "Encarnação do Demônio", "A Comédia Divina", "Sinfonia da Necrófole ", "Set It Up", "Nosso Último Verão", "Quando Nos Conhecemos", "Feito Cães e Gatos", "Bedazzled", "Questão de Tempo", "Depois de Horas", "Deadpool", "Porta dos Fundos: Contrato Vitalício", "Bad Boy Bubby", "Bad Santa", "Relatos Selvagens", "Um Santo Vizinho", " A Noite do Jogo", "Dois Caras Legais","É o Fim", "Mulher Infernal", "Raising Arizona", "Shaun of the Dead", "Todo Mundo em Pânico ", "Elvira: A Rainha das Trevas", "A Morte Te Dá Parabéns", "Como Sobreviver a um Ataque Zumbi", "A Família Addams"};
  20.  
  21.   static string[] perguntasDrama = {"Prefere os filmes de drama nacionais", "Prefere os filmes de drama atuais", "Prefere ver filmes de comédia dramática", "Gosta de ver filmes de drama de guerra", "Gosta de ver filmes de drama criminal"};
  22.   static string[] filmesDeDrama = {"Amanhã Nunca Mais", "16060", "Asa Branca: Um Sonho Brasileiro", "Entrando Numa Roubada", "Entrando numa Roubada", "A Noite da Virada", "Cidade dos Homens (filme)", "Tropa de Elite 2: O Inimigo Agora é Outro", "Gerra dos canudos", "Trash - A Esperança vem do Lixo", "Cidade de Deus", "O Lobo Atrás da Porta", "tropa de elite", "Ônibus 174", "Quase Dois Irmãos", "Cidade de Deus - 10 Anos Depois", "O Lobo Atrás da Porta", "Homens, Mulheres e Filhos", "Patch Adams", "Sociedade dos poetas mortos", "Uma Segunda Chance para Amar", "Toni Erdmann", "Um Homem Chamado Ove", "O Patriota", "O Resgate do Soldado Ryan", "Paths of Glory", "Até o Último Homem", "Midway - Batalha em Alto Mar", "Dunkirk", "Scarface", "O Poderoso Chefão", "Rush - Uma Viagem ao Inferno", "Covil de Ladrões", "Garota Exemplar", "A Entrega"};
  23.  
  24.   static string[] perguntasRomance = {"Prefere filmes de romance nacionais", "Prefere filmes de romance antigos", "Prefere ver filmes de comédia romantica", "Prefere filmes de drama romantico"};
  25.   static string[] filmesDeRomance = {" P.S. Eu Te Amo ", "Lisbela e o Prisioneiro", "Se Eu Fosse Você", "O homem perfeito", "Talvez uma História de Amor", "Bem Casados", "Pequeno Dicionário Amoroso", "Amores Possíveis", "Como Fazer um Filme de Amor", "Faroeste Cabloco", "Entre Idas e Vindas", "Todas As Canções De Amor", "Feito Cães e Gatos", "bedazzled", "Uma Linda Mulher", "questao de tempo", "Amizade Colorida", "Ligados pelo Amor", "Um Lugar Chamado Notting Hill", "Quatro Casamentos e um Funeral", "Love Actually", "A culpa é das estrelas", "Nasce Uma Estrela", "Me Chame Pelo Seu Nome"};
  26.  
  27.   static string[] perguntasAnimacao = {"Gosta mais de filmes de animação antigo", "Gosta de filmes da DC", "Gosta de filmes da Marvel", "Gosta de filmes da Dreamworks", "Gosta de filmes da MGM", "Gosta de filmes da Fox", "Gosta de filmes da Disney"};
  28.   static string[] filmesDeAnimacao = {"Grandes Astros Superman ","Liga da Justiça uerra","mulher maravilha","Hulk Onde os monstros habitão","thor o filho de asgard","O Invencivel Homem de Ferro","FormiguinhaZ","O Principe do Egito","O Caminho Para El Dorado","the Pink Panther","Tom and Jerry","Pica Pau","A Era do Gelo","Titan A.E","Anastasia","O Rei Leão","Aladdin"," A guerra dos Dálmatas","A Pequena Sereia","Mulan","Pocahondas","Hercules","lilo&stich","Robôs","A Era do Gelo 4"," Os Simpsons o Filme","O touro Ferdinando","Abominável","Shrek","Madagascar","Turbo","Trolls","O Poderoso Chefinho","A Origem dos Guardiões","O Espanta Tubarões","Cada Um na Sua Casa"};
  29.  
  30.   static string[] perguntasAcao = {"Prefere filmes de ação nacionais", "Prefere filmes de ação atuais", "Gosta de filmes de ação dramaticos", "Gosta de filmes de ação de super-herois", "Gosta de filmes de ação de comédia", "Gosta de filmes de ação de artes marciais"};
  31.   static string[] filmesDeAcao = {"Bacurau", "Reza a Lenda", "BR 716", "O 5.º Poder", "2 Coelhos", "Segurança Nacional", "O Doutrinador", "Mancha Solar.", "Capitão 7", "Shark-gir", "Raio Negro", "Miragem", "Os Farofeiros", "Lisbela e o Prisioneiro", "Até que a Sorte nos Separe ", "De Pernas pro Ar ", "Uma quase dupla", "Nao se aceita devolução", "Aldo - Mais Forte que o Mundo", "Uma quase dupla", "Reza a Lenda", "Mad Max: A Estrada da Fúria", "Máquina Mortífera ", "Duro de Matar", "Velozes e Furiosos 7", "Hancock", "Batman", "As Tartarugas Ninja", "O Máskara", "Batman", "Smaville", "Os Incríveis", "Hellboy", "Creed: Nascido para Lutar", "Guerreiro ", "Menina de Ouro ", "Quebrando Regras", "Ali", "O vencedor"};
  32.  
  33.   static string[] perguntasFantasia = {"Prefere filmes de fantasia atuais", "Gosta de filmes do Harry Potter", "Gosta de filmes de super-herois", "Gosta de filmes sobre a vida pre-historica"};
  34.   static string[] filmesDeFantasia = {"O cristal Encantado","O feitiço de Aquila","A História Sem Fim","Conan O Barbaro","Piratas do Caribe","Labirinto","Edward Mãoes de Tesoura","As Cronicas de Narnia","A bussola de Ouro","Eragon","Stardust","Harry Potter e a Pedra Filosofal","O Senhor dos Aneis","Pantera negra","Shazam","Aladdin","O Hobbit a Desolação de Smaug","Malevola Dona do Mal"};
  35.  
  36.   public static void Main (string[] args)
  37.   {
  38.     Console.WriteLine ("--------------\nBem vindo ao:\n");
  39.     // Frescurete
  40.     ExibirTelaInicial();
  41.     Console.WriteLine("Escolha o tipo de filme que você gosta, e será recomendado um filme para você:\n");
  42.     Console.WriteLine("1 - Terror");
  43.     Console.WriteLine("2 - Comédia");
  44.     Console.WriteLine("3 - Drama");
  45.     Console.WriteLine("4 - Romance");
  46.     Console.WriteLine("5 - Animação");
  47.     Console.WriteLine("6 - Ação");
  48.     Console.WriteLine("7 - Fantasia");
  49.     string entrada = Console.ReadLine();
  50.     switch(entrada)
  51.     {
  52.       case "1":
  53.         ArvoreFilme(perguntasTerror, filmesDeTerror, 1);
  54.         break;
  55.       case "2":
  56.         ArvoreFilme(perguntasComedia, filmesDeComedia, 2);
  57.         break;
  58.       case "3":
  59.         ArvoreFilme(perguntasDrama, filmesDeDrama, 2);
  60.         break;
  61.       case "4":
  62.         ArvoreFilme(perguntasRomance, filmesDeRomance, 2);
  63.         break;
  64.       case "5":
  65.         ArvoreFilme(perguntasAnimacao, filmesDeAnimacao, 1);
  66.         break;
  67.       case "6":
  68.         ArvoreFilme(perguntasAcao, filmesDeAcao, 2);
  69.         break;
  70.       case "7":
  71.         ArvoreFilme(perguntasFantasia, filmesDeFantasia, 1);
  72.         break;
  73.       default:
  74.         Console.WriteLine("Erro de comando, finalizando o programa...");
  75.         break;
  76.     }
  77.   }
  78.  
  79.   static void ArvoreFilme(string[] tipoDeFilme, string[] filmes, int numPerguntasSemDefinicao)
  80.   {
  81.     int tamanhoArvore = tipoDeFilme.Length, numPergSemDef = 0;
  82.     bool pfIni = false, pfFim = false;
  83.     Random rnd = new Random();
  84.     string[] papoFurado;
  85.     StringBuilder mensagem = new StringBuilder();
  86.     string entrada;
  87.     bool flagErro, terminar = false;
  88.     for(int i = 0; i < tamanhoArvore; i++)
  89.     {
  90.       Console.Clear();
  91.       ExibirTelaInicial();
  92.       do
  93.       {
  94.         flagErro = false;
  95.         mensagem.Clear();
  96.         if(rnd.Next(2) == 1)
  97.           pfIni = true;
  98.         if(rnd.Next(2) == 1)
  99.           pfFim = true;
  100.         papoFurado = GeradorDePapoFurado(pfIni, pfFim);
  101.         if(pfIni)
  102.           mensagem.Append(papoFurado[0] + tipoDeFilme[i].ToLower());
  103.         else
  104.           mensagem.Append(tipoDeFilme[i]);
  105.         mensagem.Append(papoFurado[1]);
  106.  
  107.        
  108.         Console.WriteLine(mensagem.ToString() + "\n\n1 - Sim\n2 - Não\n");
  109.         entrada = Console.ReadLine();
  110.         switch(entrada)
  111.         {
  112.           case "1":
  113.             indicadorRespostas.Enqueue('S');
  114.             numPergSemDef++;
  115.             if(numPergSemDef == numPerguntasSemDefinicao + 1)
  116.               terminar = true;
  117.             break;
  118.           case "2":
  119.             numPergSemDef++;
  120.             indicadorRespostas.Enqueue('N');
  121.             break;
  122.           default:
  123.             Console.WriteLine("\n\nVocê inseriu uma opção invalida, por favor tente de novo");
  124.             flagErro = true;
  125.             break;
  126.         }
  127.       }while(flagErro);
  128.       if(terminar)
  129.         break;
  130.     }
  131.     Console.Clear();
  132.     ExibirTelaInicial();
  133.     Console.Write(papoFuradoDecisao[rnd.Next(papoFuradoDecisao.Length)]);
  134.     System.Threading.Thread.Sleep(1000);
  135.     Console.Write(".");
  136.     System.Threading.Thread.Sleep(1000);
  137.     Console.Write(".");
  138.     System.Threading.Thread.Sleep(1000);
  139.     Console.Write(".");
  140.     Console.Clear();
  141.     ExibirAchei();
  142.     RecomendarFilme(filmes, numPerguntasSemDefinicao);
  143.   }
  144.  
  145.   static void RecomendarFilme(string[] filmes, int numPerguntasSemDefinicao)
  146.   {
  147.     Console.Clear();
  148.     ExibirTelaInicial();
  149.     int filmeParaSelecionar = 0;
  150.     int mult = 0, mult2 = 0;
  151.     Random rnd = new Random();
  152.     for(int i = 0; i < numPerguntasSemDefinicao; i++)
  153.     {
  154.       mult += (indicadorRespostas.Dequeue() == 'N' ? 3 : 0);
  155.     }
  156.  
  157.     for(int i = 0; i < indicadorRespostas.Count; i++)
  158.     {
  159.       mult2 += (indicadorRespostas.Dequeue() == 'N' ? 3 : 0);
  160.     }
  161.  
  162.     filmeParaSelecionar = mult + (mult2 * (numPerguntasSemDefinicao + 1));
  163.    
  164.     Console.WriteLine("Filme para selecionar: " + filmeParaSelecionar + "\nMult: " + mult + "\nMult2: " + mult2);
  165.     Console.WriteLine("Baseado nas suas escolhas eu recomendo o filme: " + filmes[filmeParaSelecionar + rnd.Next(3)]);
  166.   }
  167.  
  168.   static string[] GeradorDePapoFurado(bool inicio = false, bool fim = false)
  169.   {
  170.     string[] retorno = {"", ""};
  171.     Random rnd = new Random();
  172.     if(inicio)
  173.       retorno[0] = papoFuradoInicio[rnd.Next(papoFuradoInicio.Length)] + " ";
  174.     if(fim)
  175.       retorno[1] = papoFuradoFinal[rnd.Next(papoFuradoFinal.Length)];
  176.     return retorno;
  177.   }
  178.  
  179.   static void ExibirTelaInicial()
  180.   {
  181.     Console.WriteLine("    ____                                           __          __          ");
  182.     Console.WriteLine(@"   / __ \___  _________  ____ ___  ___  ____  ____/ /___ _____/ /___  _____");
  183.     Console.WriteLine(@"  / /_/ / _ \/ ___/ __ \/ __ `__ \/ _ \/ __ \/ __  / __ `/ __  / __ \/ ___/");
  184.     Console.WriteLine(@" / _, _/  __/ /__/ /_/ / / / / / /  __/ / / / /_/ / /_/ / /_/ / /_/ / /    ");
  185.     Console.WriteLine(@"/_/ |_|\___/\___/\____/_/ /_/ /_/\___/_/ /_/\__,_/\__,_/\__,_/\____/_/     ");
  186.     Console.WriteLine(@"    ____          ____________    __  ______________                       ");
  187.     Console.WriteLine(@"   / __ \___     / ____/  _/ /   /  |/  / ____/ ___/                       ");
  188.     Console.WriteLine(@"  / / / / _ \   / /_   / // /   / /|_/ / __/  \__ \                        ");
  189.     Console.WriteLine(@" / /_/ /  __/  / __/ _/ // /___/ /  / / /___ ___/ /                        ");
  190.     Console.WriteLine(@"/_____/\___/  /_/   /___/_____/_/  /_/_____//____/                         ");
  191.     Console.WriteLine("\n\n");
  192.   }
  193.  
  194.   static void ExibirAchei()
  195.   {
  196.     System.Threading.Thread.Sleep(1000);
  197.     Console.WriteLine(@"      ___     ");
  198.     Console.WriteLine(@"     /  /\    ");
  199.     Console.WriteLine(@"    /  /::\   ");
  200.     Console.WriteLine(@"   /  /:/\:\  ");
  201.     Console.WriteLine(@"  /  /:/~/::\ ");
  202.     Console.WriteLine(@" /__/:/ /:/\:\");
  203.     Console.WriteLine(@" \  \:\/:/__\/");
  204.     Console.WriteLine(@"  \  \::/     ");
  205.     Console.WriteLine(@"   \  \:\     ");
  206.     Console.WriteLine(@"    \  \:\    ");
  207.     Console.WriteLine(@"     \__\/    ");
  208.     System.Threading.Thread.Sleep(500);
  209.     Console.Clear();
  210.     Console.WriteLine(@"      ___           ___     ");
  211.     Console.WriteLine(@"     /  /\         /  /\    ");
  212.     Console.WriteLine(@"    /  /::\       /  /:/    ");
  213.     Console.WriteLine(@"   /  /:/\:\     /  /:/     ");
  214.     Console.WriteLine(@"  /  /:/~/::\   /  /:/  ___ ");
  215.     Console.WriteLine(@" /__/:/ /:/\:\ /__/:/  /  /\");
  216.     Console.WriteLine(@" \  \:\/:/__\/ \  \:\ /  /:/");
  217.     Console.WriteLine(@"  \  \::/       \  \:\  /:/ ");
  218.     Console.WriteLine(@"   \  \:\        \  \:\/:/  ");
  219.     Console.WriteLine(@"    \  \:\        \  \::/   ");
  220.     Console.WriteLine(@"     \__\/         \__\/    ");
  221.     System.Threading.Thread.Sleep(500);
  222.     Console.Clear();
  223.     Console.WriteLine(@"      ___           ___           ___     ");
  224.     Console.WriteLine(@"     /  /\         /  /\         /__/\    ");
  225.     Console.WriteLine(@"    /  /::\       /  /:/         \  \:\   ");
  226.     Console.WriteLine(@"   /  /:/\:\     /  /:/           \__\:\  ");
  227.     Console.WriteLine(@"  /  /:/~/::\   /  /:/  ___   ___ /  /::\ ");
  228.     Console.WriteLine(@" /__/:/ /:/\:\ /__/:/  /  /\ /__/\  /:/\:\");
  229.     Console.WriteLine(@" \  \:\/:/__\/ \  \:\ /  /:/ \  \:\/:/__\/");
  230.     Console.WriteLine(@"  \  \::/       \  \:\  /:/   \  \::/     ");
  231.     Console.WriteLine(@"   \  \:\        \  \:\/:/     \  \:\     ");
  232.     Console.WriteLine(@"    \  \:\        \  \::/       \  \:\    ");
  233.     Console.WriteLine(@"     \__\/         \__\/         \__\/    ");
  234.     System.Threading.Thread.Sleep(500);
  235.     Console.Clear();
  236.     Console.WriteLine(@"      ___           ___           ___           ___     ");
  237.     Console.WriteLine(@"     /  /\         /  /\         /__/\         /  /\    ");
  238.     Console.WriteLine(@"    /  /::\       /  /:/         \  \:\       /  /:/_   ");
  239.     Console.WriteLine(@"   /  /:/\:\     /  /:/           \__\:\     /  /:/ /\  ");
  240.     Console.WriteLine(@"  /  /:/~/::\   /  /:/  ___   ___ /  /::\   /  /:/ /:/_ ");
  241.     Console.WriteLine(@" /__/:/ /:/\:\ /__/:/  /  /\ /__/\  /:/\:\ /__/:/ /:/ /\");
  242.     Console.WriteLine(@" \  \:\/:/__\/ \  \:\ /  /:/ \  \:\/:/__\/ \  \:\/:/ /:/");
  243.     Console.WriteLine(@"  \  \::/       \  \:\  /:/   \  \::/       \  \::/ /:/ ");
  244.     Console.WriteLine(@"   \  \:\        \  \:\/:/     \  \:\        \  \:\/:/  ");
  245.     Console.WriteLine(@"    \  \:\        \  \::/       \  \:\        \  \::/   ");
  246.     Console.WriteLine(@"     \__\/         \__\/         \__\/         \__\/    ");
  247.     System.Threading.Thread.Sleep(500);
  248.     Console.Clear();
  249.     Console.WriteLine(@"      ___           ___           ___           ___                 ");
  250.     Console.WriteLine(@"     /  /\         /  /\         /__/\         /  /\        ___     ");
  251.     Console.WriteLine(@"    /  /::\       /  /:/         \  \:\       /  /:/_      /  /\    ");
  252.     Console.WriteLine(@"   /  /:/\:\     /  /:/           \__\:\     /  /:/ /\    /  /:/    ");
  253.     Console.WriteLine(@"  /  /:/~/::\   /  /:/  ___   ___ /  /::\   /  /:/ /:/_  /__/::\    ");
  254.     Console.WriteLine(@" /__/:/ /:/\:\ /__/:/  /  /\ /__/\  /:/\:\ /__/:/ /:/ /\ \__\/\:\__ ");
  255.     Console.WriteLine(@" \  \:\/:/__\/ \  \:\ /  /:/ \  \:\/:/__\/ \  \:\/:/ /:/    \  \:\/\");
  256.     Console.WriteLine(@"  \  \::/       \  \:\  /:/   \  \::/       \  \::/ /:/      \__\::/");
  257.     Console.WriteLine(@"   \  \:\        \  \:\/:/     \  \:\        \  \:\/:/       /__/:/ ");
  258.     Console.WriteLine(@"    \  \:\        \  \::/       \  \:\        \  \::/        \__\/  ");
  259.     Console.WriteLine(@"     \__\/         \__\/         \__\/         \__\/                ");
  260.     Console.WriteLine("\n☺");
  261.     System.Threading.Thread.Sleep(2000);
  262.   }
  263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement