Keeping it straight - Programmers Heaven

Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Keeping it straight

mremanmreman Posts: 2Member
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?


Sign In or Register to comment.