Skip to content

sagarshah16/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

tic-tac-toe

"Tic-tac-toe, also called noughts and crosses (in the British Commonwealth countries), X's and O's (in Ireland) and X and 0 (in India) is a pencil-and-paper game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The X player usually goes first. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game." (Wikipedia)

Create a basic tic-tac-toe game for the console. The game should work as follows:

  1. Output a board in the following format:

1 2 3 1 | | ---+---+--- 2 | | ---+---+--- 3 | |

No other board format will be accepted. You must number the rows and columns, not each box.

  1. Ask the user for a row and column number.
  2. Put the appropriate symbol for that player (X or O) in the specified spot.
  3. Repeat for the next player until someone has won the game.
  4. If someone has won, announce which player won and exit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages