Keeping it straight

Hey everyone,
OK, I am a newb. I have been trying to complete a program for class and havent been able to keep some things straight in the console.

I input
Console.WriteLine(" |{0}|{1}|{2}|{3}|{4}|", gameBoard(0, 0), gameBoard(0, 1), gameBoard(0, 2), gameBoard(0, 3), gameBoard(0, 4))

Console.WriteLine(" |{0}|{1}|{2}|{3}|{4}|", gameBoard(1, 0), gameBoard(1, 1), gameBoard(1, 2), gameBoard(1, 3), gameBoard(1, 4))

Console.WriteLine(" |{0}|{1}|{2}|{3}|{4}|", gameBoard(2, 0), gameBoard(2, 1), gameBoard(2, 2), gameBoard(2, 3), gameBoard(2, 4))

Console.WriteLine(" |{0}|{1}|{2}|{3}|{4}|", gameBoard(3, 0), gameBoard(3, 1), gameBoard(3, 2), gameBoard(3, 3), gameBoard(3, 4))

Console.WriteLine(" |{0}|{1}|{2}|{3}|{4}|", gameBoard(4, 0), gameBoard(4, 1), gameBoard(4, 2), gameBoard(4, 3), gameBoard(4, 4))

Which writes my array to the console .. in this program the user can input a number between 1 and 25 into any area in the array . If it is a single digit number the array table stays alligned in the console. If someone inputs a double digit into the array it throws the look off and it is nolonger a square. Is there any way that I can keep the board straight?

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories