/
ALGORITHM FORcomputer picks a number !!while user hasn't guessed corre ALGORITHM FORcomputer picks a number !!while user hasn't guessed corre

ALGORITHM FORcomputer picks a number !!while user hasn't guessed corre - PDF document

liane-varnes
liane-varnes . @liane-varnes
Follow
393 views
Uploaded On 2016-06-10

ALGORITHM FORcomputer picks a number !!while user hasn't guessed corre - PPT Presentation

FROM THE CODE computer picks a number while user hasnt guessed correctly and they havent reached 7 guesses get a guess from the user if number is too high say so if number is too low say ID: 356216

FROM THE CODE !!computer picks

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "ALGORITHM FORcomputer picks a number !!w..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

ALGORITHM FORcomputer picks a number !!while user hasn't guessed correctly and they haven't reached 7 guesses !!get a guess from the user !!if number is too high, say so FROM THE CODE !!computer picks a number !!while user hasn't guessed correctly and they haven't reached 7 guesses !!get a guess from the user !!if number is too high, say so if number is too low, say so !!increment number of guesses by 1 !!if they've guessed correctly, display congratulations !!else display game over message !!Set up 3 variables in your script for the guessing game CLASS Error: math is not defined Source File: file:///H:/CMPT100Tutorial5/ Display the instructions for the game using the alert() function !!alert(Òmy text for the alert goes in here"); If you put a semi-colon at the end of the while loop the computer will assume that the loop is finished and the body of the while loop wonÕt execute FILL END Use with the . !!E.g., document.bgColor = color; !!If youÕre using a variable !!E.g., document.bgColor = ÒredÓ; !!If youÕre just using a colour !!Needs to be the last line in your block of code with document.write WORKING? !!Common places to look for errors !!Did you spell variables correctly? !!Is your code in order? Are you trying to use variables before they have a value associated with them !!American English spelling of words like color !!Are all semi-colons where they need to be? !!Use syntax highlighting to find errors !!Did you concatenate your strings properly? !!+ in the right places !!Proper use of double quotation marks !!Using the error console in Firefox to find problems with your script !!Tools Ð Error Console !!Tip: clear the error console, then force refresh !!Errors option will give you information about what