Giter VIP home page Giter VIP logo

tictactoe-bots's Introduction

tictactoe-bots

This is an experiment to practice with genetic algorithms and bot building. The program uses a typical genetic algorithm to engineer a bot to play a game of Tic-Tac-Toe.

However, there is one interesting facet. I challenged myself to make the bots as stupid as possible. That is, I didn't want to say things like 'automatically block a win' or 'automatically take a win' - basically, I didn't want my own ideas of what makes a good/bad bot to influence the algorithm at all. In other words, I wanted to see how well the algorithm worked with a large space and a weak heuristic.

This means that a bot is literally a collection of pairs - for every possible board state, it has knows which move it would make.

Well, there are an awful lot of board states, so each bot is actually a terrifically huge amount of data. In order to compress this down, a list of all possible board states is created up front, removing board states that are just reflections or rotations of other board states. Each board state is then packaged up with all of the possible moves remaining (which is less than 9), and so for each board state a bot must store only a single number smaller than 9. This can be packaged up into a collection of bits (very carfully), so that, in the end, each bot is only 75 16-bit words.

The bots are graded by facing off in tournaments, with the best proceeding on, and 'breeding' with other bots by retaining move choices from each parent, with a small amount of randomness.

tictactoe-bots's People

Contributors

brianshourd 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.