Forums Register Login

Printing an array using nested for loops? (Code edited)

+Pie Number of slices to send: Send
Hi, I'm trying to print this tic-tac-toe board out using arrays and nested for loop.
The board has 3 rows and 3 columns.



This is what I have so far, and it's printing the same String of the array board three times with || between.
I've been stuck for a while and I'd appreciate any help, thanks!

+Pie Number of slices to send: Send
The code you posted don't even compile. Please PostRealCode that you wrote.
+Pie Number of slices to send: Send
I dont think you need to be using Arrays.deepToString instead you can use the element variable. You are already traversing the array.
1
+Pie Number of slices to send: Send
The way this website is set up, multiple whitespace does not appear. You should enclose your printout in code tags. I have edited your post, and you can see how much better it looks.
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1181 times.
Similar Threads
printing character array vertically with loop
Battleships - guys please help me out!
cleaner code
A for loop problem
2D array battleship
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:18:24.