Giter VIP home page Giter VIP logo

cheatermind's Introduction

Cheatermind

MasterMind clone where you are never lucky.

That is, the computer AI will stay consistent with whatever it has already said about your guesses, but it will cheat by not deciding on the final code until it has no other choice.

For a simplest example, pretend you're playing with one slot and two colours. This is the equivalent of a coin toss. Whatever you guess first will turn out not to be the right answer, because as soon as you guess it, the AI will cheat and pretend that the other one was the correct answer all along. So it will always take you two guesses.

The question is, how well can you do, given that you're cursed with such bad luck?

Compare your minimum with a play-through that uses the "best automatic guess" feature. :-)

Playing Online

You can play a live demo at: https://ibwwg.itch.io/cheatermind

Playing Locally

It's assumed you have Node, npm, and git installed.

You also need yarn installed globally. If you do not have it:

npm install --global yarn

With yarn installed:

git clone https://github.com/IBwWG/cheatermind
cd cheatermind
yarn
npm run build

Then launch public/index.html in your browser. The clickable dots set your current guess, and the arrow makes your current guess official, and grades it for you.

Tests

npm test

Questions of Interest

  1. What's the minimum number of moves for a given slot + colour configuration in this worst-case scenario? Does the current implementation always produce it?
  2. Is it possible to come up with a formula for this?
  3. How can the AI be made more memory-efficient, so as to scale better?

cheatermind's People

Contributors

codingthat avatar ibwwg avatar

Watchers

 avatar

cheatermind'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.