A and D to move the chainsaw. Don't let logs touch the floor. Double press flag to start after death.
A game of quick thinking. Base code was made in a hour.