Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Leandro Soares
- // Gerador de Nicknames
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <ctype.h>
- #include <time.h>
- #include <string.h>
- #define TRUE 1
- int ini();
- int fim();
- int main()
- {
- while(TRUE)
- {
- int MAX, x, controlo, z, lastr;
- char nick[255];
- MAX=x=controlo=z=lastr=0;
- MAX = ini();
- srand((unsigned)time(NULL));
- for(;x<MAX;x++)
- {
- printf("-");
- for(z=0;z<2;z++)
- {
- controlo = rand() % 20 + 1;
- if(controlo == lastr)
- {
- z--;
- continue;
- }
- lastr=controlo;
- switch(controlo)
- {
- case 1:strcpy(nick,"fox");break;
- case 2:strcpy(nick,"mini");break;
- case 3:strcpy(nick,"wili");break;
- case 4:strcpy(nick,"bone");break;
- case 5:strcpy(nick,"famous");break;
- case 6:strcpy(nick,"super");break;
- case 7:strcpy(nick,"maxi");break;
- case 8:strcpy(nick,"fama");break;
- case 9:strcpy(nick,"roedor");break;
- case 10:strcpy(nick,"cagado");break;
- case 11:strcpy(nick,"borboleta");break;
- case 12:strcpy(nick,"peixe");break;
- case 13:strcpy(nick,"dead");break;
- case 14:strcpy(nick,"porno");break;
- case 15:strcpy(nick,"stoper");break;
- case 16:strcpy(nick,"trouble");break;
- case 17:strcpy(nick,"bubble");break;
- case 18:strcpy(nick,"merdilento");break;
- case 19:strcpy(nick,"tanga");break;
- case 20:strcpy(nick,"sapato");break;
- }
- printf("%s", nick);
- }
- printf("\n");
- }
- if(fim())
- {
- printf("\n\n");
- return 0;
- }
- system("cls");
- }
- return 0;
- }
- int ini()
- {
- int a;
- while(TRUE)
- {
- printf("Nicks para gerar: ");
- a=0;
- scanf("%d", &a);
- if( a<1 || a>50 )
- {
- printf("\n\n\tMinimo: 1\n\tMaximo: 50\n\n\n");
- system("pause");
- system("cls");
- continue;
- }
- printf("\n\n");
- return a;
- }
- }
- int fim()
- {
- int c;
- printf("\n\n\n");
- printf("Repetir? Y/N");
- while(TRUE)
- {
- c=0;
- c=getch();
- c=toupper(c);
- if( c == 'Y' )
- return 0;
- if( c == 'N' )
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement