I am trying to make a game, where the machine takes a while to respond, so the user actually knows the machine is 'deciding' its move.
I need to use the setTimeout()
method, but I want to specify a parameter to my function.
Example: setTimeout(myFunction('p'), 1000);
.
The problem is that when I specify the parameter, the function runs perfectly fine, but there´s no delay.