aspose file tools
The moose likes Beginning Java and the fly likes Trying to print my board to output. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Trying to print my board to output." Watch "Trying to print my board to output." New topic
Author

Trying to print my board to output.

Edward Strife
Greenhorn

Joined: Mar 15, 2012
Posts: 14
I am trying to print the board to output after each change. The first change sets the entire board to one symbol. The second change sets the board to alternating symbols. I need the printBoard() method to only print the board, not modify it.

Any help would be greatly appreciated.


John Jai
Bartender

Joined: May 31, 2011
Posts: 1778
The method printBoard() should print the output value rather than the object Board.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 4905
    
    7

John Jai wrote:The method printBoard() should print the output value rather than the object Board.

Actually, there's nothing particularly wrong with doing it that way...
@Edward: ...providing you implement a toString() method for your Board.

I'm puzzled. Why did you comment out that loop? It looks more like what you want to do.

Winston
John Jai
Bartender

Joined: May 31, 2011
Posts: 1778
Agree... But he also try to create a new instance of Board in the printMethod(). So thought he might understand printing output better
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to print my board to output.
 
Similar Threads
while loop and try-catch
print invalid selction not working
need help with calculation in my spreadsheet array
Switch Statement
array out of bounds