Snake game in C & JavaScript