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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment