Giter Club home page Giter Club logo

masterminder's Introduction

masterminder

I wrote this little script a few years ago. As the holiday season comes upon us once again, I decided to spruce it up with some nice colors—and a voice—for another year of family mischief.

This is a program that plays Mastermind... and always wins! To play in interactive mode (i.e. for facing off against your friend), just run:

$ python masterminder.py

(Don't be alarmed—it talks!)

If you instead just want to see it play against itself by giving it a pattern to start with, just run

$ python masterminder.py ABCD

where ABCD is any string of four colors that represent the secret configuration (for example, WWOO for white-white-orange-orange).

E.g.

A screenshot of the program.

Behind the scenes

This script essentially implements the minimax algorithm as demonstrated by Donald Knuth in 1977.

Feel free to adjust the variables at the top of the file to fit your version of the game.

masterminder's People

Contributors

theopolisme avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

masterminder's Issues

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.