Got it done, 14 hour marathon today. And was a code test, for an interview, not a review.
I fucked up a bit due to exhaustion.... I had a very long if/else chain that called a different function in each "if" clause.
I realised too late I should have used a rules engine, but I was concentrated on lots and lots of other stuff.
I did refactor it and improve it, but it is still quite shit. I just commented my thoughts on it, checked in, went to bed.