How can i build such a game based on the things i've learnt so far from Codecademy?


#1

I don't know how to start my code...

I even don't know about the Math.random() function until i google the game.I am a newbie,but why does Codecademy skip the Math.random() function? How do you all know about the function?

Thanks!


#2

when you have problems, you can check "Hint" to get some help. The functions you are talking about are explained there.


#3

You can also use a linter such as https://repl.it or http://jsbin.com to write code in and get feedback on errors. Use google to look up other functions built into javascript.


#4

Thanks for reply.Unfortunately, i found no "hint" on this one.:frowning:


#5

It is a bit tough, I believe Math.random() is explained on that particular page, though. Honestly, I just went through that part yesterday so I can help you. I've found between this site/codeschool that they both have major flaws in either both programming or useless hints/no answers/proper help.

Codeschool is great for having answers/walkthroughs easily at your hand if you're completely stuck, although it has it's minor programming issues (sometimes you have the right code and it won't accept until page is refreshed).

Both Codeschool and this site seem to assume you know certain things without explaining them which is very annoying especially when you're paying good money for their services.

Codecademy accepts code a lot of the time that won't even execute properly elsewhere. I know for a fact as i've had my friend who works at a job doing Python and JS help me through a bunch of exercises and he laughed at some of the major mistakes I was making that were still accepted by Codecademy. This isn't a good thing as you're not going to learn properly. I'd say Codeschool is much better overall, at least you have answers and walkthroughs on almost every section you code (for $10 more a month, it also has videos/slides you can use).

The hints are USELESS on this website 95% of the time! My JS friend and I also found that some of the questions on this site are worded so poorly it was even a struggle for him to understand what they were trying to ask and he's been doing this for 15 years.


#6

I'll give you the first part of the code and see if you can finish the rest on your own!

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();

console.log(computerChoice);

if (0 < computerChoice <= 0.33) {
computerChoice = "rock";
}
else if (0.34 <= computerChoice <= 0.66) {
computerChoice = "paper";
}
else {
computerChoice = "scissors";
}

If you need help understanding it don't hesitate to ask.

  • Also on a side note, I searched google and you can find the exact answer for this question on there (there are a few different sites but one of them is exactly the same code).

#7

Thanks for reccommandation of Codeschool, i will try it later.


#8

If you just signed up for the first time here you can cancel for free within the first 14 days I think, good luck.


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.