Full code is below its not optimized for speed if you can post the optimizations that can be implemented, heres a LOL that i came across when i was coding this last night.
Any Problems comments are welcome; there are a lot of C programmers in EK if you can translate this to C :) there are very...