Hey, this isn't C, so I don't need headers, but you can #include kix.c if you like :-P
Tested on all relevant platforms, mostly dice boards ;\)
The UDF zone is not compliant with this logic ;\)
I did use a var but it needs no declaration ;\)

So there!