I have completed the Rock Paper Scissors game in the codecademy lesson. I wan to try to make another basic game using JS. Ideas?


I will also accept any other basic JS challenges.


This may be kinda out of your reach but what about a Tic-Tac-Toe Game…


That is a great idea but how would I go about doing it?


See… the fun things about challenges is figuring it out on your own… When you become a programmer when you grow up, no-one is going to assist you… So you should try to do it then ask. Hope this is usefull…


what about a guessing game?
the user has to guess the number between a defined range


I’ll give the guessing game a shot. Its a good idea.


super, I think it is similar to the rock paper scissors game and you are also going to learn something new.

let us know if you need help :slight_smile:


Already working on it. Thanks!


The guessing game is a good idea. Make it give the user 3 tries, and tell them whether it’s lower, higher, or correct. If they don’t guess it after 3 times they fail.


just 3 times … I think that would be hard to guess :grin:


Im only doing 1-10 now, if i get it I will try up to 100


This is how I will assign the number to guess. Thoughts?

var CN = Math.random();
  if (CN <= 0.10) {
    CN = 1;
  else if (CN <= 0.20) {
    CN = 2;
  else if (CN <= 0.30) {
    CN = 3;
  else if (CN <= 0.40) {
    CN = 4;
  else if (CN <= 0.50) {
    CN = 5;
  else if (CN <= 0.60) {
    CN = 6;
  else if (CN <= 0.70) {
    CN = 7;
  else if (CN <= 0.80) {
    CN = 8;
  else if (CN <= 0.90) {
    CN = 9;
  else  {
    CN = 10;


You can save yourself some work there. Think about this: what exactly are you doing to each initial CN to get the final number?


Do you mean like multiplying by 10 and rounding?


Yes, like that. Do you feel that you need to check the value each time? Could you use math to just do what needs to be done to your initial CN = Math.random(); and not worry about all those different values?


This might be a bad question, but what does math random do again?


That is the sort of thing you ask Google. :slight_smile: and you test – try asking for and printing values using Math.random()

If you want the specs, the first paragraph gives you that.


would it be something like
var CN = Math.random();
CN = Math.round(CN * 10);


I’m not trying to avoid directly answering your questions, I’m trying to give you the tools to hunt down these sorts of answers yourself.

If I were working on something and I didn’t know if it was doing what I wanted it to, I would test it by getting it to print out CN after you first assign it a random number and then again after you do the next step to it. Test it a whole bunch of times.