I want to print
*****
*****
*****
*****
*****
by using a for loop in the console of unity by using Debug.Log() of monoDevelop. Here is my code:
for(int row=1;row<=5;row++)
{
for(int column=1; column<=5;column++)
{
Debug.Log("*");
}
}
But it shows the output in this way:
*
*
*
*
*
till 25 rows.
Debug.Log() is a new lineIf you want to log a line of anything you need to concatenate it into a string, then Log() that string.
for(int row=1;row<=5;row++)
{
string str = "";
for(int column=1; column<=5;column++)
{
str += "*";
}
Debug.Log(str);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With