Advertisement
FoxTuGa

Gerador de Nicks <outdated>

May 8th, 2011
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.00 KB | None | 0 0
  1. // Leandro Soares
  2. // Gerador de Nicknames
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <conio.h>
  7. #include <ctype.h>
  8. #include <time.h>
  9. #include <string.h>
  10.  
  11. #define TRUE 1
  12.  
  13. int ini();
  14. int fim();
  15.  
  16. int main()
  17. {
  18.     while(TRUE)
  19.     {
  20.         int MAX, x, controlo, z, lastr;
  21.         char nick[255];
  22.         MAX=x=controlo=z=lastr=0;
  23.         MAX = ini();
  24.  
  25.         srand((unsigned)time(NULL));
  26.         for(;x<MAX;x++)
  27.         {
  28.             printf("-");
  29.             for(z=0;z<2;z++)
  30.             {
  31.                 controlo = rand() % 20 + 1;
  32.                 if(controlo == lastr)
  33.                 {
  34.                     z--;
  35.                     continue;
  36.                 }
  37.                 lastr=controlo;
  38.                 switch(controlo)
  39.                 {
  40.                 case 1:strcpy(nick,"fox");break;
  41.                 case 2:strcpy(nick,"mini");break;
  42.                 case 3:strcpy(nick,"wili");break;
  43.                 case 4:strcpy(nick,"bone");break;
  44.                 case 5:strcpy(nick,"famous");break;
  45.                 case 6:strcpy(nick,"super");break;
  46.                 case 7:strcpy(nick,"maxi");break;
  47.                 case 8:strcpy(nick,"fama");break;
  48.                 case 9:strcpy(nick,"roedor");break;
  49.                 case 10:strcpy(nick,"cagado");break;
  50.                 case 11:strcpy(nick,"borboleta");break;
  51.                 case 12:strcpy(nick,"peixe");break;
  52.                 case 13:strcpy(nick,"dead");break;
  53.                 case 14:strcpy(nick,"porno");break;
  54.                 case 15:strcpy(nick,"stoper");break;
  55.                 case 16:strcpy(nick,"trouble");break;
  56.                 case 17:strcpy(nick,"bubble");break;
  57.                 case 18:strcpy(nick,"merdilento");break;
  58.                 case 19:strcpy(nick,"tanga");break;
  59.                 case 20:strcpy(nick,"sapato");break;
  60.                 }
  61.                 printf("%s", nick);
  62.             }
  63.             printf("\n");
  64.         }
  65.         if(fim())
  66.         {
  67.             printf("\n\n");
  68.             return 0;
  69.         }
  70.         system("cls");
  71.     }
  72.     return 0;
  73. }
  74.  
  75. int ini()
  76. {
  77.     int a;
  78.     while(TRUE)
  79.     {
  80.         printf("Nicks para gerar: ");
  81.         a=0;
  82.         scanf("%d", &a);
  83.         if( a<1 || a>50 )
  84.         {
  85.             printf("\n\n\tMinimo: 1\n\tMaximo: 50\n\n\n");
  86.             system("pause");
  87.             system("cls");
  88.             continue;
  89.         }
  90.         printf("\n\n");
  91.         return a;
  92.     }
  93. }
  94.  
  95. int fim()
  96. {
  97.     int c;
  98.     printf("\n\n\n");
  99.     printf("Repetir? Y/N");
  100.     while(TRUE)
  101.     {
  102.         c=0;
  103.         c=getch();
  104.         c=toupper(c);
  105.         if( c == 'Y' )
  106.             return 0;
  107.         if( c == 'N' )
  108.             return 1;
  109.     }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement