Giter Site home page Giter Site logo

alphabeta's People

Contributors

panchishin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

alphabeta's Issues

How to handle loss and draw conditions with only checkWinConditions?

I am working on a game that ends when all squares on a board have been filled. Each player much fill a square whenever it is his turn.
The player wil the most squares of his color is the winner. Equal amounts of occupied squares indicate a draw. How should I handle this with this package?

Generating next possible states is doing to much work

As a rule of thumb alphabeta roughly has a branching factor of the sqrt(number of possible moves). So because this implementation generates all possible states it does a lot of unneccessary work. It would be better to generate moves and then when needed perform/play the move and generate the new state.

It can them be decided if undoing/takingback the move on a single state is faster/slower then generating new states.

Introducing moves has the other great advantage that it is easier to sort them in an order that speeds of the alphabeta algorithm. Keeping a best move per depth (killer move heuristic) and trying that move first for instance can greatly reduce the searchtime.

implement killer move

This function could be really useful but as an absolute minimum it should try the best move from a depth search first during the next (deeper) depth search. Because in that case there is always a good move available when result.incomplete is returned.

It would be very good for the algorithm speed to keep a last best move for each depth. (see also: #2)

BTW "incriment" should be spelled "increment"

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.