Campbell Ritchie wrote:Get the Game class running so you print “X's turn” followed by a pretty‑print of the board.
Don't know. I think those four methods should be public instance methods and not take the board/grid as a parameter. Yes, use the board field.Prasanna Raman wrote: . . . do I need the getBoard() method? . . . Can I remove geBoard(), make those 4 methods public but not static and use the board instance?
Thank you very muchCampbell Ritchie wrote:The fact that you made that suggestion makes me think you are getting to think object‑oriented. (
)
Campbell Ritchie wrote:Get the Game class running so you print “X's turn” followed by a pretty‑print of the board.
Two Players, surely.Prasanna Raman wrote: . . . Shouldn't the Game class have Player as one of its attributes? . . .
Thank you! I'll work on the Player class then.Campbell Ritchie wrote:Player? Now. You somehow must ensure there are only two Player instances at any time. You can have Player X and Player O. Each Player can have a count of games played and won and lost.
Please read this.Prasanna Raman wrote:Not sure if you've been busy, but posting this in case you didn't receive notification.
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|