1$(document).ready(() => {
2 setInterval(() => {
3 $('p').fadeIn();
4 $('p').fadeOut();
5 }, 500);
6});
1var buttonColours=["red", "blue", "green", "yellow"];
2var gamePattern=[];
3
4function nextSequence(){
5 var randomNumber = Math.floor(Math.random()*4);
6 var randomChosenColour= buttonColours[randomNumber];
7 gamePattern.push(randomChosenColour);
8 $("#randomChosenColour").fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);
9 }
10