Thread: Matrix code (c)

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    6

    Red face Matrix code (c)

    Ok...
    Iwanted to make a matrix effect as a start-up screen but it doesnt give the effect i want... how can i do it in a sense that it types in ascii vertically...
    can you help me?

    check out this code... it runs but it doesnt give the effect that i want...
    Code:
    main()
    {
    int i;
    clrscr();
    l:
    for(i=0;i<=127;i++){
    delay(1000);
    printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n"
            ,i,i+100,i,i+120,i,i+50,i,i+60,i,i+130,i,i+200,i,i+10,i,i+20,i,i+80,i,i+120,i,i+190,i,i+112,i,i+102,i,i+143,i,i+152,i,i+151
            ,i,i+28,i,i+58,i,i+78,i,i+98,i,i+81,i,i+21,i,i+132,i,i+131,i,i+138,i,i+18,i,i+82,i,i+13,i,i+12,i,i+21,i,i+28,i,i+24
            ,i,i+77,i,i+44,i,i+21,i,i+328,i,i,i+24);}
    goto l;
    }

  2. #2
    eh ya hoser, got a beer? stumon's Avatar
    Join Date
    Feb 2003
    Posts
    323
    i is int. you printf() %c. this is wrong, you need to printf() %d and what is the goto for, infinite loop?

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Use gotoxy() to move the marker somewhere on the screen and then print a letter there. Then increase the Y by one and print the next letter below it.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. matrix multiplication code
    By weneedhelp in forum C++ Programming
    Replies: 1
    Last Post: 04-11-2007, 06:50 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Replies: 3
    Last Post: 12-22-2004, 07:29 PM
  5. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM