Replying to [C++] Effetto Matrix

  • Create account

    • Nickname:
  • Enter your Post

    •              
           
       
      FFUpload  Huppy Pick colour  HTML Editor  Help
      .
    •      
       
      Clickable Smilies    Show All
      .
  • Clickable Smilies

    • :huh:^_^:o:;):P:D:lol::B)::rolleyes:-_-<_<:)
      :wub::angry::(:unsure::wacko::blink::ph34r::alienff::cry::sick::shifty::woot:
      <3:XD:*_*:];P:XP:(:=)X):D:>.<>_<
      =_=:|:?3_3:p:;_;^U^*^^*:=/::*::b::f:

  •   

Last 10 Posts [ In reverse order ]

  1. Posted 16/3/2013, 20:57
    Oggi mi sono divertito a creare un codice che ripetesse una stringa nello stile Matrix. Ho usato C++ ma ho riscritto lo stesso codice anche in C (sì, oggi avevo tempo da buttare xD)

    Ma veniamo al codice...

    CODICE
    #include <iostream>
    #include <stdlib.h>

    using namespace std;

    int main(int argc, char *argv[])
    {
    string rpString = "011010"; // Stringa da ripetere
    int k = 1;
    int rp = 2000; // Numero di ripetizioni
    system ("color 0a");
    while ( k != rp ) {
    k += 1;
    cout << rpString << " ";
    _sleep (5);
    }
    system("CLS");
    system("PAUSE");
    return 0;
    }


    oppure in C
    CODICE
    #include <stdio.h>

    int main()
    {
    char* rpString = "011010"; // Stringa da ripetere
    int k = 1;
    int rp = 2000; // Numero di ripetizioni
    system ("color 0a");
    while ( k != rp ) {
    k += 1;
    printf("%­s ", rpString);
    _sleep (5);
    }
    system("CLS");
    system("PAUSE");
    return 0;
    }

Review the complete topic (launches new window)