Git Product home page Git Product logo

master_mind's Introduction

Master Mind

Is a code-breaking game. More info in Wikipedia

Reason for implementing

This is my personal project to study clean code, TDD and other software engineering best practices as SOLID principles.

It is based on the exercise proposed by Uncle Bob's screen cast in Episode 9, Single Responsability Principle

Game explanations

Code

A Code is defined by disposed order of pegs, where each peg can have a different color (state). The default configuration is 4 pegs and 6 colors.

A Code can be compared to each other and it gives a Score for this comparison

Score

A [Score] represents how many pegs are in the same position for both codes. And how many pegs are in both codes but in diferent positions

Some examples

Where '+' represents a peg in the same position, and '-' a peg in both codes but diferent positions:

  • If the secret code is "AABB" and the guess is "BBAE", the score is "---".
  • If the secret code is "ABCD" and the guess is "ACDB", the score is "+---".

More examples should be easly readable in Code spec file

Secret Code Holder

A SecretCodeHolder is responsible for holding a code and answering scores to the guesser.

Code Breaker

The CodeBreaker is responsible for breaking the code.

It starts with a guess, then receive a score for this current guess and makes a new guess.

master_mind's People

Contributors

prosanes avatar

Watchers

 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.