• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to print my board to output.  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method printBoard() should print the output value rather than the object Board.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agree... But he also try to create a new instance of Board in the printMethod(). So thought he might understand printing output better
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!