Skip to content

jo4x962k7JL/Tic-Tac-Toe-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Tic-Tac-Toe-Game

Simple text-based implementation

Example 1

$ python3 Tic-Tac-Toe.py

0 | 1 | 2              |   |
---------           -----------
3 | 4 | 5              |   |
---------           -----------
6 | 7 | 8              |   |

You are "x", Select a spot(0~9): 1

0 | 1 | 2            o | x |
---------           -----------
3 | 4 | 5              |   |
---------           -----------
6 | 7 | 8              |   |

You are "x", Select a spot(0~9): 4

0 | 1 | 2            o | x |
---------           -----------
3 | 4 | 5              | x |
---------           -----------
6 | 7 | 8              |   | o

You are "x", Select a spot(0~9): 7

0 | 1 | 2            o | x |
---------           -----------
3 | 4 | 5              | x | o
---------           -----------
6 | 7 | 8              | x | o

You Win!

Example 2

$ python3 Tic-Tac-Toe.py

0 | 1 | 2              |   |
---------           -----------
3 | 4 | 5              |   |
---------           -----------
6 | 7 | 8              |   |

You are "x", Select a spot(0~9): 2

0 | 1 | 2              |   | x
---------           -----------
3 | 4 | 5              | o |
---------           -----------
6 | 7 | 8              |   |

You are "x", Select a spot(0~9): 5

0 | 1 | 2              | o | x
---------           -----------
3 | 4 | 5              | o | x
---------           -----------
6 | 7 | 8              |   |

You are "x", Select a spot(0~9): 0

0 | 1 | 2            x | o | x
---------           -----------
3 | 4 | 5              | o | x
---------           -----------
6 | 7 | 8            o |   |

You are "x", Select a spot(0~9): 3

0 | 1 | 2            x | o | x
---------           -----------
3 | 4 | 5            x | o | x
---------           -----------
6 | 7 | 8            o | o |

You Lose!

Example 3

$ python3 Tic-Tac-Toe.py

0 | 1 | 2              |   |
---------           -----------
3 | 4 | 5              |   |
---------           -----------
6 | 7 | 8              |   |

You are "x", Select a spot(0~9): 1

0 | 1 | 2              | x |
---------           -----------
3 | 4 | 5              |   |
---------           -----------
6 | 7 | 8              | o |

You are "x", Select a spot(0~9): 8

0 | 1 | 2              | x |
---------           -----------
3 | 4 | 5              |   | o
---------           -----------
6 | 7 | 8              | o | x

You are "x", Select a spot(0~9): 2

0 | 1 | 2              | x | x
---------           -----------
3 | 4 | 5              |   | o
---------           -----------
6 | 7 | 8            o | o | x

You are "x", Select a spot(0~9): 3

0 | 1 | 2            o | x | x
---------           -----------
3 | 4 | 5            x |   | o
---------           -----------
6 | 7 | 8            o | o | x

You are "x", Select a spot(0~9): 4

0 | 1 | 2            o | x | x
---------           -----------
3 | 4 | 5            x | x | o
---------           -----------
6 | 7 | 8            o | o | x

No one wins!

About

Simple text-based implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages