Giter Site home page Giter Site logo

set_solver's Introduction

SET SOLVER

The game of set โ€” finding groups of cards that either match or vary in different aspects โ€” is an interesting exercise in combinatorics and, when solving programatically, problem representation. See below!

DEPENDENCIES

  • Solution components require only Python core
  • Test suite uses pytest
  • See requirements.txt for complete package and version info

USAGE

  • Install dependencies via pip install -r requirements.txt
  • The set_solver module provides both deck generation and game solving
  • A deck is a collection of cards to be searched for Sets
  • A card is a list of length dimensions, where each entry is an integer in the interval [0, feature_size]
  • Example: a game with dimensions color, shape, and number, and 4 possible values for each, would be described as: dimensions = 3, feature_size = 4 with cards like [0, 2, 3] or [2, 2, 2]
  • The get_card_collection method provides a deck of cards for a given game setting
  • To find all solution sets in a deck, use the solution_generator method
  • This generator yields lists of length match_size of cards from deck
  • Each solution satisfies the rules of a game of Set
  • To provide validation of the input deck, solution_generator requires the game setting parameters (dimension and feature_size)

TESTS

  • Correctness follows from local correctness of is_set method and the checking of every possible combination of cards in deck
  • Testing suite can be ran by simply invoking py.test in this directory
  • Unit/integration testing can be ran separately via (for ex.) -m unit
  • Unit tests verify input validation and output consistency with alternative combinatoric toolboxes like the math and itertools packages
  • Integration test takes example decks and verifies the results

set_solver's People

Contributors

bhtucker avatar

Watchers

 avatar

Forkers

leon-barrett

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.