Nice code guys, especially Corsix's hyperstring
My original idea was to write code in a simple language like BrainFuck
, put it in string literals and use a little interpreter (about 200 tokens). But this would require a massive amount of time to code, since BrainFuck is very low-level.
Shortly before the deadline Gamma and I discussed the idea to generate some function that would assign a numeric value to a 7-card hand, which would preserve the ordering using those cool string lookups. We both never got the time to work further on it... well, it might very well be infeasible. Anyway - nice contest, I'm really sorry for not participating
Why use brainfuck and an interpreter, why not just create a big machine code string and execute it directly as I believe corsix had suggested. It's the same idea and you save having to use the interpreter.
I was playing with the idea of working with the whole 7 cards but couldn't come up with anything efficient. So basically used next_permutation to shuffle between all variations. It was a bit overkill since I only needed combinations (21 to be exact) but it was token effiecient.(I wonder why next_combination doesn't exist?) and then I assigned a value to it in order to break ties.
Me and Corsix "discussed" back and fourth his hyperstring method since it used it's own source file as the run-time input/storage for his hyperstring . I was against it, but allowed it barring no complaints from other contestants. (I had suggested this idea early on but threw it out because of the resulting 25 meg file it produced and the inability to work with the file/string of that size) so I give corsix some credit on pulling it off.