A-ma-zing. My first thought was to follow the simple strategy of just having diagonal green buttons all the time, but then comes the train and it messes everything up.
Nicely done!