Simon game [Problem Help]

Simon game [Problem Help]
0.0 0

#1

Hi, Campers

This is my simon game project links : https://codepen.io/tanwanjern/pen/awNoYq

Question 1 : why the voice button able to click after i off?


#2

You’re not doing anything to stop it from playing. Your switch has a style for being “off”, but you don’t yet have a way to tell your program that it should be off.


#3

Ok, fixed that. Another Question : Why it didnt show win after i finish 20 times?


#4

I only briefly glanced at your code, but line 124 reads: else if (typeof computer[20] !== "undefined"), I think that you mean computer[19] – an index of 20 is the 21st element because arrays in js are zero based (e.g. 0 is the first element).


#5

still not working…have any better suggestion?


#6

So, the best way to get help on the forums is to ask specific questions. “Why doesn’t my code work?” isn’t a very good question because you’re asking people to debug your code for you. Fixing things is part of the learning process. You should know your code better than anyone else, so you ought to know where to look.


#7

its ok. Its actually work but I hv some bug start from the random machine I think. thank you for yr reply!