it wont display right here but i think you get the point.
I am somewhat able to do that but i need to slow the display so that it looks like it is a triangle and want to be able to run it for as long as possible as this program is just for show...
int strlength = str.Length;//variable that keep string length
int width = Console.WindowWidth, height = Console.WindowHeight;
//check to see if string is exist
if(strlength != 0){
Console.Clear();
orix = Console.CursorTop;
oriy = Console.CursorLeft;
//check to see if the console width is 80 or set it
if(width != 80){
Console.SetWindowSize(80, height);
}
int y = 0;
while(true){
int hw = Console.WindowWidth/2;
int halfway = hw;
int ht = hw - strlength;
int inc = 2;
int incy = 0;
int s = 1;
for(int i=0;i<strlength;i++){
if(i == strlength-1){
inc = -2;
}
string stri = "";
for(int n=0;n<s;n++){
stri += str[i];
}
s += inc;
echo(stri,halfway,y);
y++;
if(i == 0){
incy = -1;
}
if(halfway == ht){
incy = 1;
}
halfway = halfway+incy;
}
Console.WriteLine(strlength-1);
}
}
else{
System.Console.WriteLine("A string needs to be entered for this program to work");
System.Console.ReadKey();
}
}
}
it works for like a sec and there is text but it is so fast you cant read the text and then i get a error after that.
error:
The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was 3420.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.