reset password
Author Message
sidguttula
Posts: 16
Posted 15:22 Jun 03, 2016 |

For this problem, I am able to display random x's and o's of any sized matrix. However, I don't know what to do next. What do we do to display that all the x's and o's are in a certain row or column?

rcamach7
Posts: 31
Posted 15:41 Jun 03, 2016 |

Well you need to tell the user, after creating your random table, if there are any row, columns, major diagonals, or minor diagonals full of X's or O's.

I created methods for each one of these, having the method check if it meets each one of these (eg. row full of X's or columns full of X's). If so, just have in print out if any of these are true. You'll need to have a loop go though each row/column to test out these fields.

It's very similar to problem one incase you get stuck.

Last edited by rcamach7 at 15:41 Jun 03, 2016.
kknaur
Posts: 540
Posted 21:23 Jun 03, 2016 |

Make sure that you are creating a 2D array with x's and o's and storing them in the array.  I don't know when you say "display" if you are just randomly generating the characters and then printing them, or if you are actually storing them in an array and then printing them out.