Skip to content
/ ttt Public
forked from jserv/ttt

An implementation of tic-tac-toe in C, featuring an AI powered by the negamax algorithm

License

Notifications You must be signed in to change notification settings

huaxinliao/ttt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ttt

An implementation of tic-tac-toe in C, featuring an AI powered by the negamax algorithm.

This program operates entirely in the terminal environment. Below is its appearance as it awaits your next move:

 1 |  ×
 2 |     ○
 3 |
---+----------
      A  B  C
>

To execute a move, enter [column][row]. For example:

> a3

Press Ctrl-C to exit.

Game Rules

The winner is determined by the first player who successfully places three of their marks in a row, whether it be vertically, horizontally, or diagonally, regardless of the board size.

For this two 4x4 board games as examples,

 1 |  ×  ×
 2 |     ○  ×
 3 |     ○
 4 |     ○
---+------------
      A  B  C  D
>

The palyer "○" wins the game since he placed his marks in a row vertically (B2-B3-B4).

 1 |  ×  ×  ○
 2 |  ×  ○  
 3 |  ○  
 4 |     
---+------------
      A  B  C  D
>

The palyer "○" wins the game since he placed his marks in a row diagonally (A3-B2-B1).

Reference

About

An implementation of tic-tac-toe in C, featuring an AI powered by the negamax algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.3%
  • Makefile 1.7%