[go: nahoru, domu]

Skip to content

Javascript Four-in-a-row (connect-4) against a Monte Carlo AI.

License

Notifications You must be signed in to change notification settings

h34tnet/mcfour.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

4-in-a-row

A simplicistic implementation of 4-in-a-row/connect 4 in javascript with a bot that uses the monte carlo tree search for its AI.

  • Implemented with webworkers and canvas for rendering
  • Monte carlo tree search
  • Starting player is randomly selected

To win, place 4 of your stones in a horizontal, vertical or diagonal line.

How does the AI work?

If it's the AIs turn, for every free column it simulates placing a stone in it and then continues to fill the board randomly 1000 times, until one player wins (adjustable in the "difficulty" setting). It then selects the column with the best win/loss ratio.

About

Javascript Four-in-a-row (connect-4) against a Monte Carlo AI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages