Giter Site home page Giter Site logo

tic-tac-toe's Introduction

Tic Tac Toe

Game developed with C language. There are 3 modes for this game:

  • Player vs Player
  • Player vs Smart AI Computer
  • Player vs Random AI Computer

To Play

Code is developed in Linux and compiled using gcc. To run the code, compile and run in Terminal with:

gcc PlayerVsComputer.c && ./a.out

Smart AI

Algoritm used for Smart AI is reactive planning algorithm:

  1. If the computer can immediately win on its current move, it will play the winning move and ends the game.
  2. If the opponent is about to win on the next move, it can block the opponents’ winning move.
  3. If neither above 2 scenarios occurs, the computer falls back to the random AI.

Player vs Player

Players takes turn to play as shown below.




Player vs Computer


Player vs Smart AI



Player vs Random AI



Result of AI vs AI

Since the AI does not have strategies to win as it only plays based on conditions, the AI will not always win/draw. Hence, the result of the AI vs AI is shown below:


Additional Information

Additional information about the research can be found here

tic-tac-toe's People

Contributors

xian-cong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.