Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- e.g.3x3 tic tac toe we'll number them 1,2,3,4,...
- could have chosen a 3x3 array but we'll just do 1-9.
- also have to take care of x and o
- human and computer also.
- x or o goes first
- human
- computer
- we have to allow either to be x or o, and also allow human and computer to be the thing that goes first.
- board( ) = 0 for blank
- 1 for human move, this is more fundamental. want to evaluate the best move for the computer
- 2 for computer move
- so if x in 2 and o in 6
- board(2) = 1
- board(6) = 2
- board = 0 1 0
- 0 0 2
- 0 0 0
- to write a subroutine
- printboard that will just print out the current state of the board.
- contents of board array, etc. what should print to the screen
- hint: if you define a character array, x is character not a number...you define a character array cboard(9) and assign elements of it to blank, x, or o and depends on contents of WHAT
- subroutine has to have two arguments
- 1: board
- 2: player x who determines who is x and who is o
Add Comment
Please, Sign In to add comment