I'm a JavaScript Games Maker: The Basics

I'm a JavaScript Games Maker: The Basics — page 3
Math QUIZ Now let's code a simple math quiz This will be a chance for you to get to know JavaScript a little better If you've done some coding before you will be familiar with the idea of variables and IF statements We will look at how to use these concepts in JavaScript STEP START YOUR TEXT EDITOR The syntax is very important in JavaScript Syntax means making sure all the commands and symbols are typed correctly On a PC Click Start Programs Sublime Text On a Мас Click the Sublime Text icon see page 5 for help SK STEP 2 ENTER THE CODE Sublime Text Carefully type in your math quiz questions For the question What is 8x 8 Answer 64 add the following code into your text editor for lines 1 to 6 Start JavaScript Ask a question If the user's answer is 64 then Show a message box saying Correct End JavaScript STEP 3 SAVE YOUR CODE Your text editor may Indent your lines of code automatically If It does not make sure that you indent your lines of code as shown in the examples Click File Save and type quiz html as the filename Make sure you save it in your Documents folder Just as you end a sentence with a period you should end JavaScript statements with a semicolon