Thought "how bad can it be" and left thinking that the world maybe is filled with bad programmers like this guy.
And on a more positive note: he did write that code, is looking for help from people more capable and eventually will likely figure it out. Check back in a decade or so how he's doing, likely you'll be surprised. Writing terrible code and learning from it is a lot better than not writing code at all.
It's easy enough to forget that at some point in time we were all clueless newbies.