Open The Lock explainer


#10

Yeah I’ve tried to change it to 9 to check but grasshopper :cricket: said I wasn’t allowed.


#11

This stage is very basic and understandable. Typically I wouldn’t be here, but on my Samsung Galaxy Note 8, after I set up -
if (foundKey === ‘no’)
I am unable to click after ‘no’ and add the && to check for the pinNumber. Everytime I click string and type no, click done and then click the && button, it then adds parenthesis in the statement, which makes sense… but there’s no seeable option to complete this stage for me.
plz fix


#12

Hey @Rex,

Thanks for flagging! This is an issue we’re aware of and working to fix. To add && to an expression, you need to select the expression (which is the hard part). Right now, you can do this by tapping between the === symbol and the variable or value.

Alternatively, you can reset your code and then update foundKey == 'yes' to be foundKey === 'no'.

Thanks for flagging this issue — it helps us to priortize new features.

H :slight_smile:


Unable to complete "Open The Lock"
#13

Yup! The pinNumber variable is defined in hidden additional code like this:

var pinNumber = 10;

H :slight_smile:


#14

Yep, same here I was wondering why we weren’t setting the variable. So confused by this lack of code in the problem. Also the lack of knowing where the strings yes and no come into play. I wish the whole problem was laid out. I think I understand it now though.


#15

Hi, i have a small quiery,why are we using print(‘pin number is’ + pin number) when we can directly write print(pin number)
cant we is it correct or not
And why we add + symbol in front of pin number


#16

Hello, I also came here because I didn’t understand this problem due to code missing. Are there any other levels where code missing so I know to expect it?

It’s more problematic and confusing for beginners if all the code is not present every time.


#17

Hey @AnoopChandran7991,

You can use just print(pinNumber), but that will only print out 10 rather than ‘The pin number is 10’.

The + symbol can be used to add numbers together, as well as combining two strings of letters. You may find this comment on the Math Modifier explainer useful.

H :slight_smile:


#18

Hey @Liquis,

Thanks for the feedback! There are a few other puzzles in the Fundamentals course (and several in the Animations courses) where there is hidden code. As you’re coding ability progresses, in order to focus on new things we often have to hide a bit of the code so that it isn’t overwhelming.

In this case, hiding the variables simply cuts down on the amount of code shown and I agree with you that can be quite confusing. We’re actively working on a way to surface this to users better.

Thanks again for the feedback,
H :slight_smile:


#19

Thank you Heather for the response. Would it be possible to provide a webpage that has a list of all the hidden code for each problem, so we can reference it? While you work on integrating it into the software.

Thanks,
Danny


#20

Hey @Liquis,

For the Fundamentals course, you can see the hidden code in the explainer under the ‘additional code’ section.

Thanks!
H :slight_smile:


#21


Why we have used print in the first two lines ?
@Grasshopper_Heather plz help me to understand it .


#22

The first two print statements are to help you check that your code is running correctly. If you don’t know what the pinNumber and foundKey values are, it’s hard to know if your If Statements have the correct test.

For example, if your code always printed ‘The pin number is right, but you are missing the key.’, why could that be happening? Perhaps the value of foundKey is ‘no’ and the pinNumber is 10 every time you run the code. Or maybe there is a mistake in your If Statement test? It helps to see what the value of foundKey and pinNumber if you want to know which If Statements should be true or false.

–Frankie


#23

This stage is very basic and understandable. Typically I wouldn’t be here, but on my Samsung Galaxy Note 8, after I set up -

if (foundKey === ‘no’)

I am unable to click after ‘no’ and add the && to check for the pinNumber. Everytime I click string and type no, click done and then click the && button, it then adds parenthesis in the statement, which makes sense… but there’s no seeable option to complete this stage for me.
plz fix


#24

Hey @Rex,

I responded on the explainer thread, but linking here too incase you don’t see it.

Thanks for flagging this feedback,
H :slight_smile:


#25

I am having a problem to solve it. It is continuous telling me that I have deleted some statements. I have done what is suggested but still stack in the same problem.
If (founder === (‘no’ && pinNimber === print (‘you don’t found the key’))
}


#26

Hi @Sambizus,

  1. You have three ( and two ); they must be paired.

  2. === is used to compare two things. You have pinNumber on the left of a === and a command, print, on the right.


#27

It still doesn’t resolve my problem.


#28

Hi @Sambizus,

This was a small bug on our side with the && and || operators: if you tried to enter them with only the last part of an expression selected (such as only 'no' selected, rather than founder === 'no'), the parentheses are applied like the example you shared.

We’ve fixed this now, so if you update the app and try adding && or || again we won’t place them within parentheses. To solve the Open The Lock puzzle, you can also reset the code, and then edit the value; you don’t need to add in && or || — which may have been why you were seeing warnings about some statements being removed.

Hope this helps a little!
H :slight_smile:


#29

oooh I found a typo in this one. (Thanks to my newfound code knowledge. And my eyes ;). I’ll let y’all spot this one!