Not understanding what is going on here, only using constants...

The problem with that code is that there are no functions in it. You can't use something like pinMode() outside of a function.

Also what Arrch said.