There are three reasons why a program would look like this:
1. It is something simple implemented in a complicated way.
2. It is something complicated implemented in a simple way.
3. It is something complicated implemented in a complicated way.
I believe this is an example of case 3, meaning even though it is something advanced, it should not take code that looks insane to express it.