Skip to content

Xareth/TicTacToe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TicTacToe

By Xareth 2019*

Machine Learning by Beginner

This is my 1st program created in python and uploaded to GitHub. I have decided to create something fancy enough to be admired and simple enough to show beginners that it is possible to create usefull programs in the beginning of their carriers

What this program can do?

It is a simple Tic Tac Toe game. In order to turn on vs ai mode you have to change code a bit. Right now it is prepared to teach AI. However, if you want to play with it, just change function human_player_move(), variable choice to int(input('write your choice from 1-9'))

How to use it?

Just run main.py, and your AI will start learning. If you want to see how your AI works without any knowledge, just delete data in files 'wins.csv' and 'loses.csv. Then, ai will start from the beginning.

In order to reset score, just change 'score.csv' file: (you can copy it from below)
games
0
wins
0
loses
0
win ratio
0

How does it work?

main.py - is a file where TicTacToe game is programmed. In the main function there is direct reference to ai.py

ai.py - is a file where all ai functions are writen

win / loses csv - are the files where Ai is storing it's knowledge. When deleted AI is starting to learn from the beginnig.

score.csv is the file which you can look in to see the current statistics of the ai

About

Machine Learning by Beginner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages