Game Design and Project Resources: The Workshops Quarter > Non-game Programs - The Tinkers' Workshop

Quick Secret Santa Thing

(1/2) > >>

Othko97:
With festivities approaching I made a thing which allocates a thing in a set of things to another thing in that same set of things. This is suitable for generating a Secret Santa Mapping, which was its original purpose, but it is also suitable for generating games of Assassin, or possibly unsolvable versions of those 15-puzzle things made of slidey squares, or basically just any bijective function f from a finite set X into itself such that for all x in X, x =/= f(x). Requires Python3 because cx_freeze is too much effort right now (and I will probably edit the thing if I ever get the motivation), and it generates a .txt file for each name containing the mapping for that name, plus one containing the full map, all contained within a folder. This is overwritten any time you run, so watch out for that. This is so that the mapping can be secret to everyone if you want it to be.


This works by selecting two elements at random and transposing them, then repeating this until no element maps to itself. Not exactly the most elegant solution, or the quickest, but meh, it works.


Have fun. Note there is also no guarantee the program will halt, it is entirely possible (but unlikely) that it will run for an inordinate amount of time. File name stands for SecretSantaScript, thought it was a fun little contraction.

comrade_general:
I thought you meant we were going to do an Exilian secret Santa. :'(

Jubal:
We could do one, would anyone be up for it? Would provide a test drive for this software too!

Othko97:
We could, we'd have to be pretty quick about it though seeing as we'll probably have to post stuff all over the place :P


EDIT: I also thought about making this able to work with email too, so it just emails a person who they're buying for, but email is miles over my head...

comrade_general:
I would, hence the crying. Except I don't even know what to get the other people I need to get gifts for.

Navigation

[0] Message Index

[#] Next page

Go to full version