GithubHelp home page GithubHelp logo

christmas_gift_pairs's Introduction

christmas_gift_pairs

To use, just modify the christmas_pairs.py file and replace the names of the adults and the kids with real first names. (No spaces -- use underscores instead.)

Don't forget to chmod +x christmas_pairs.py on Mac or Linux and then execute. (On Windows, you'll probably need to execute it with your Python interpreter after installing it; don't forget that you'll have to use an actual programming editor to edit the script -- don't try it with Word, but even Notepad will work as an editor.)

Make sure that the number of adults is each two and the number of groups of parents match each of the groups of kids (in other words, if there are seven families, then there should be seven groups of parents and seven groups of kids; including the parents is probably optional, but it's included here since it's easy to do.)

This script basically brute-forces a bunch of pairings and tries to match up just one kid with another, even with mismatched family sizes, and tries to avoid one child buying for another in the same family.

The algorithm is pretty quick and dirty -- more elegant pull requests appreciated.

christmas_gift_pairs's People

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.