Use arrow keys to move. There is a bug that allows you to squeeze through walls but do not try that as that ruins the fun. Also, if you are stuck, press 'h'. Try to get to the chest by making it through a lot of levels and not-so-trolling trolls.
The treasure chest from @scratch_testing123 Special thanks to Roboto Coding Academy for inspiration and some of the code, although there is no debug for squeezing through walls :(