I have been stuck on this exercise for 30mins + now


#1

I really just need someone to post the correct code, so that I can visually see what I am doing wrong. I do not know how to set the conditions for computerChoice BETWEEN NUMBERS. Have not covered that in previous lessons. I have tried as much as I know, but I get continuous syntax errors and am at my wits end!! SOMEONE PLEASE HELP AND POST THE CORRECT SYNTAX! THANKS

I AM NOT JUST LOOKING TO GET THE ANSWER TO PASS LESSONS. I NEED TO SEE IT TO LEARN WHAT I AM DOING WRONG AND WHAT I SHOULD BE DOING!


#2

@johndavis1986,

Please read
http://www.codecademy.com/forum_questions/559dcb4be39efe550f00006b
and concentrate on:

  • the creation of the compare function
  • the truth-table
  • the build of the IF ELSE-IF statement structure as part of the compare FUNCTION-BODY
  • the execution of the compare function (keeping in mind that the return statement is used )

#3

You can use code to set up an condition between to numbers by using && (AND) or || (OR) to chain two statements together. But this is not covered so far and you actually don't need it. Math.random() already gives you numbers that are in a specific range (from 0 to very very close to 1). So if you want your numbers to be from 0 to 0.33 you don't have to deal with the lower range but just check for the upper range. same for the else case and for the one in the middle well the lower boundary from this one is already dealt by your first if statement isn't it?

Anyway it would help a lot if you could show your code so that we can fix your syntax errors and maybe give you some hints on this. As said sure you can use advanced techniques on this one but you could as well beat it with what you've learned so far.