User Tools

Site Tools


cs509:tictactoe_sample_2-player_game

TicTacToe: Sample 2-player game (human vs. human)

 This is a Tic Tac Toe program. Choose the type of game: 
 (1) human o vs. human x    (2) human o vs. dumb computer x

 -> 1

1 2 3 
4 5 6 
7 8 9 
 

 It's o's turn.
 Input the number of an empty square: (-1 to quit) 5

1 2 3 
4 o 6 
7 8 9 
 

 It's x's turn.
 Input the number of an empty square: (-1 to quit) 1

x 2 3 
4 o 6 
7 8 9 

 It's o's turn.
 Input the number of an empty square: (-1 to quit) 4

x 2 3 
o o 6 
7 8 9 
 

 It's x's turn.
 Input the number of an empty square: (-1 to quit) 2

x x 3 
o o 6 
7 8 9 
 

 It's o's turn.
 Input the number of an empty square: (-1 to quit) 6

x x 3 
o o o 
7 8 9 
 

 Player o is the winner.
cs509/tictactoe_sample_2-player_game.txt · Last modified: 2013/03/20 05:21 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki