javascript implementation of simon says