Post: Scrolling text
11-25-2013, 06:49 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Well, I saw someone posted this on facebook so I figured I'd optimize and fix it up a bit. Anyways, here it is :p

My Version:
    #include <iostream>
#include <Windows.h>

using namespace std;

int main()
{
while (true)
{
int length = 50, randInt = rand() % 9, a = 0, b = 0, i = 0 , j = 0;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), randInt);
for (i; i < length; i++)
{
cout << "WELCOME";
Sleep(50);
system("cls");
for (; j <= i; j++)
cout << " ";

j = 0;
}
system("cls");
for (a; a < length - 1; a++)
{
for (b; b < length - 1; b++)
cout << " ";

cout << "WELCOME";
Sleep(50);
system("cls");
b = a;
}
}
}


Their version:
    #include<iostream>
#include<windows.h>

using namespace std;
int main()
{
int len=50;
start:
/////////////forward////////
int i=0;
int j=0;
for(i;i<len;i++)
{
cout<<"WELCOME";
Sleep(50);
system("cls");
for (;j<=i;j++)
{
cout<<" ";
}
j=0;
}
////////////////////////back////
int a=0;
int b=0;
system("cls");
for (a;a<len-1;a++)
{
for(b;b<len-1;b++)
{
cout<<" ";
}
cout<<"WELCOME";
Sleep(50);
system("cls");
b=a;
}
goto start;
}
(adsbygoogle = window.adsbygoogle || []).push({});
12-01-2013, 09:13 PM #2
What exactly is this for?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo