Giter Club home page Giter Club logo

competitive_search's Introduction

Competitive Search: Minimax and AB Pruning

Intro

This is a quick introduction to minimax search through the game Connect 4.

When you you have completed this introduction, minimax agent which you have created will probably be able to beat you at Connect 4.

The contents of this introduction take for granted that you've paid at least a little bit of attention to the lecture.

Getting started

  1. Git clone and "npm install"

  2. There's only one file which you'll editing, which is "minimax.js." BEFORE starting to edit it, finish reading these instructions.

  3. To test your changes to minimax.js, "npm test." IMPORTANT NOTE: Passing the tests does not necessarily mean you've successfully written an intelligent agent. You can pass the tests without actually using the minimax algorithm. To test that your agent is really playing well, you'll need to play against your agent yourself.

  4. To play against the machine, run "npm start." This will start up a server; use a browser to go to localhost:8888 to play against the agent you've written in minimax.js. If you start up the server before you've started writing your agent, you'll note that you're playing against a randomly-playing (i.e., extremely stupid) agent.

Advice

  1. There are all sorts of correct answers regarding the substance of the heuristic function. Make something up; so long as it passes the tests, it will probably work with minimax. Remember that the basic idea is just to roughly evaluate how good the state is.

  2. Minimax itself is a bit more rigid, but it only takes a few lines to implement.

  3. Minimax alpha-beta pruning is a little harder to visualize, so don't feel discouraged if you have difficulty with it. It is only a few more lines than minimax itself, though, so if you're writing a lot you're probably going wrong.

competitive_search's People

Contributors

jctillman avatar

Watchers

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