Wednesday, October 21, 2009

How would i do a tic tac toe program using just arrays, methods, loops... just the basics basically?

A two dimensional array with three columns and three rows can be used to record the tic tac toe game.





If you're aiming for a command line version (versus something with a graphic user interface), you can ask the user for input (such as "x 2 3") and interpret it as their move (such as "place an x in row 2 column 3). Simply record the "x" in the array.





You'll need to make a method that checks if the player has won - this method will be called after every move.



fashion accessories

No comments:

Post a Comment