Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 1.67 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. /* Wallpaper Matrix - Letras aleatórias aparecem na tela.
  2.  *
  3.  * by pH - iBlogeek.com
  4.  *
  5.  * 26 de Abril de 2009
  6.  *
  7.  * Todos os direitos reservados
  8.  *
  9.  */
  10.  
  11. #include <iostream>
  12. #include <time.h>
  13. #include <cstdlib>
  14. using namespace std;
  15.  
  16. int main()
  17. {
  18.  
  19.         int um;
  20.         int dois;
  21.         int tres;
  22.         int quatro;
  23.         int cinco;
  24.         int seis;
  25.         int sete;
  26.         int oito;
  27.         int nove;
  28.         int dez;
  29.         int onze;
  30.         int douze;
  31.         int treze;
  32.         int catorze;
  33.         int quinze;
  34.         int dezesseis;
  35.         int a;
  36.         int b;
  37.         int c;
  38.         int d;
  39.        
  40.         char start;
  41.         char cDoagain ='s';
  42.        
  43.         system("clear");
  44.        
  45.         cout <<"Pressione S para iniciar o Wallpaper Matrix! "<< endl;
  46.         cin >> start;
  47.        
  48.         if (start == 'S'||start == 's')
  49.         {
  50.  
  51. do
  52. {
  53.         system("sleep 0,05"); // Setar o tempo! (1 = um segundo / 0,7 = Setenta milésimos / 0,07 = Sete milésimos)
  54.        
  55. um = (rand() % 1000) + 1;
  56. dois = (rand() % 1000) + 1;
  57. tres = (rand() % 1000) + 1;
  58. quatro = (rand() % 1000) + 1;
  59. cinco = (rand() % 1000) + 1;
  60. seis = (rand() % 1000) + 1;
  61. sete = (rand() % 1000) + 1;
  62. oito = (rand() % 1000) + 1;
  63. nove = (rand() % 1000) + 1;
  64. dez = (rand() % 1000) + 1;
  65. onze = (rand() % 1000) + 1;
  66. douze = (rand() % 1000) + 1;
  67. treze = (rand() % 1000) + 1;
  68. catorze = (rand() % 1000) + 1;
  69. quinze = (rand() % 1000) + 1;
  70. dezesseis = (rand() % 1000) + 1;
  71. a = (rand() % 1000) + 1;
  72. b = (rand() % 1000) + 1;
  73. c = (rand() % 1000) + 1;
  74. d = (rand() % 1000) + 1;
  75.  
  76. cout << um <<" "<< dois <<" "<< tres <<" "<< quatro <<" "<< cinco <<" "<< seis <<" "<< sete <<" "<< oito <<" "<< nove <<" "<< dez <<" "<< onze <<" "<< douze <<" "<< treze <<" "<< catorze <<" "<< quinze <<" "<< dezesseis <<" "<< a <<" "<< b <<" "<< c <<" "<< d <<" "<< endl;
  77. }while (cDoagain == 's');
  78.  
  79. }
  80. }