build snake using js