I'm trying to do a project with regard to displaying two separate text-animation in one line which shall display like this 
I am using inheritance for this. I, however, can't display them in one line. I need assistance aligning them in the same line as the image provided.
Here is the screenshot of the code.
I can't seem to upload the code.
public void Egg()
{
Console.Write(" ___" +
"\n / \\" +
"\n |’ |" +
"\n \\___/");
//return;
}
public void Cat()
{
Console.Write("\n _,'| _.-''``-...___..--';" +
"\n /_ \\'. __..-' , ,--...--'''" +
"\n <\\ .`--''' ` /'" +
"\n `-';' ; ; ;" +
"\n __...--'' ___...--_..' .;.'" +
"\n (,__....----''' (,..--'' " +
"");
//return;
}
public class My_Calculation : Program
{
static void Main(string[] args)
{
My_Calculation demo = new My_Calculation();
demo.Egg();
demo.Cat();
Console.Read();
}
}
I am open to suggestions if there is a better way of solving this. Thanks in advance!
You won't be able to align them when you print one after the other. The egg has new line characters in it which means that something printed after it will always be underneath it.
The simple solution to this is to print the cat and the egg at the same time i.e. have the cat and egg in the same string.
Update:
To Achieve what (I think) you want to do, all you need is to have a token that you replace with whitespace to make the cat move closer to the egg e.g.:
The method
PrintImageWithSpaces()prints the cat and the egg with the specified number of spaces between them. By staring off with x number of spaces and then reducing the number of spaces each time you callPrintImageWithSpaces(), the cat moves closer to the egg.Calling
DoAnimation()would provide an example of the animation that you want.i.e.:
Note: the time delays are added in the above code so you can see the prints gradually added but you wouldn't need them if you print each time a user inputs a wrong answer.