add a implementation of snake in javascript