r/programmingbydoing • • Aug 13 '14

Project TicTacToe

How do I implement the playMove method?

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/holyteach Aug 14 '14

If playMove() doesn't do anything, the game won't "play".

There is nothing you can "copy" from main() that will help you write the implementation of the playMove() method.

What I mean is that you can look at the sample main() to see what the code looks like that calls playMove().

ttt.playMove( p, r, c );

The playMove() method is called with three arguments. A char 'p' containing either the value 'X' or 'O'. An int 'r' containing the row in which to place the 'X'/'O'. And an int 'c' containing the column in which to place the specified letter.

I'm suspecting that you're trying to "skip" straight to this assignment without having done the 175 assignments before this point. In particular, it seems like you're weak on arrays.