You have to be logged in to leave a comment.
Sign In
1
<p>1. Inside <strong>game.js</strong> create a <strong>new function</strong> called <code>nextSequence()</code></p><p>2. <strong>Inside</strong> the new function generate a new <strong>random number</strong> between <strong>0</strong> and <strong>3</strong>, and store it in a <strong>variable</strong> called <code>randomNumber</code> </p><p>You can use the Chrome console to verify that your code creates random numbers between the correct range. </p><figure><img height="207" src="https://img-b.udemycdn.com/redactor/raw/2018-11-22_10-29-46-f35b1b67fdc733fee6b115ffa13d6930.png" width="259"></figure><p>3. At the top of the <strong>game.js </strong>file, create a new <strong>array</strong> called <code>buttonColours</code> and set it to hold the sequence <code>"red", "blue", "green", "yellow"</code> .</p><p>4. Create a new variable called <code>randomChosenColour</code> and use the <code>randomNumber</code> from step 2 to select a random colour from the <code>buttonColours</code> array.</p><p>5. At the top of the <strong>game.js </strong>file, create a new empty array called <code>gamePattern</code>.</p><p>6. Add the new <code>randomChosenColour</code> generated in step 4 to the end of the <code>gamePattern</code>.</p><p><br></p><p>Note: If you need any hints, try scrolling down. 👇</p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p>Hint 1. Remember this is how you create and call functions in JavaScript:</p><figure><img src="https://img-b.udemycdn.com/redactor/raw/2018-11-21_10-49-16-dbc2029ddafc91ff42f957991183f40f.png"></figure><p><br></p><p>Hint 2A. Remember this is how you generate random numbers between 0 and 0.9999...</p><figure><img src="https://img-b.udemycdn.com/redactor/raw/2018-11-21_10-54-49-dac0c523ff494299585241f4f0f9f9c5.png"></figure><p>Hint 2B. Remember this is how you round down a number.</p><figure><img src="https://img-b.udemycdn.com/redactor/raw/2018-11-21_10-56-32-94e4bcb5449f8685596a9d5140b3c55d.png"></figure><p>Hint 3. Remember this is how arrays are created in JavaScript:</p><figure><img src="https://img-b.udemycdn.com/redactor/raw/2018-11-21_10-59-38-052565b0de9dc8cec5d67ab8a7a84053.png"></figure><p>Hint 4. Remember this is how you select items inside arrays:</p><figure><img src="https://img-b.udemycdn.com/redactor/raw/2018-11-21_11-20-00-0f9c30930f660a2a95faa6975cd75a68.png"></figure><p>Hint 6. Remember this is how you add new items to arrays:</p><figure><img src="https://img-b.udemycdn.com/redactor/raw/2018-11-21_11-17-26-1e31d6dbe809a3cf701896e4e93c8983.png"></figure>
Press p or to see the previous file or,
n or to see the next file
Comments
Integrate AWS S3
Use S3 remote
Select bucket
Access key
Finish
Use AWS S3 as storage!
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your S3 bucket
Select Region
af-south-1 - Africa (Cape Town)
ap-northeast-1 - Asia Pacific (Tokyo)
ap-northeast-2 - Asia Pacific (Seoul)
ap-south-1 - Asia Pacific (Mumbai)
ap-southeast-1 - Asia Pacific (Singapore)
ap-southeast-2 - Asia Pacific (Sydney)
ca-central-1 - Canada (Central)
eu-central-1 - EU (Frankfurt)
eu-north-1 - EU (Stockholm)
eu-west-1 - EU (Ireland)
eu-west-2 - EU (London)
eu-west-3 - EU (Paris)
sa-east-1 - South America (São Paulo)
us-east-1 - US East (N. Virginia)
us-east-2 - US East (Ohio)
us-gov-east-1 - US Gov East 1
us-gov-west-1 - US Gov West 1
us-west-1 - US West (N. California)
us-west-2 - US West (Oregon)
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with AWS S3!
Delete Storage Key
Are you sure you want to delete this access key?
No
Yes
Integrate Google Cloud Storage
Use Google Storage
Select bucket
Upload key
Finish
Use Google Cloud Storage!
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your Google Storage bucket
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with Google Cloud Storage!
Delete Storage Key
Are you sure you want to delete this access key?
No
Yes
Integrate Azure Cloud Storage
Use Azure Storage
Select bucket
Set key
Finish
Use Azure Cloud Storage!
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your Azure Storage bucket
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with Azure Cloud Storage!
Delete Storage Key
Are you sure you want to delete this access key?
No
Yes
Integrate S3 compatible storage
Use S3 like remote
Select bucket
Access key
Finish
Use any S3 compatible storage!
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your S3 bucket
Bucket name cannot be the same as the repository name. Please change one of them.
Check this box only if you trust this domain, otherwise your data and credentials might be
stolen by man in the middle or spoofing attacks.
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with your S3 compatible storage!