Discuss Scratch

scurnell
New to Scratch
3 posts

Electronic Safe Project PLEASE HELP !!

I am attempting to write a program for an electronic safe for a school project. The program must follow the criteria below.
1. The safe must have a 4 digit combination which is pre-set to ‘1234’ – the safe should only unlock when this code is entered.
2. The safe should present the user with a welcome message and a prompt to enter the code.
3. If a user makes 3 incorrect attempts to enter a code, the safe will lock everyone out and an alarm will trigger.
4. If a user enters a code that is shorter or longer than 4 digits the safe will reject the code as incorrect but will not count it as a valid attempt, assuming the user made an error.

I have managed to solve the problems for steps 1, 2 & 4, however i cannot seem to work out how to recognise an incorrect 4 digit code in step 3.
[
img]https://scratch.mit.edu/projects/132892234/#editor

Can anybody help
card100
Scratcher
1000+ posts

Electronic Safe Project PLEASE HELP !!

if <4 = (length of (answer))> then 

Code for if the it is 4 digits

else
Code if it isn't 4 digits
end
Hope this helps!

-card100
asivi
Scratcher
1000+ posts

Powered by DjangoBB