J'ai considéré vos différentes suggestions pour codifier le programme comme suit :
Code : Tout sélectionner
10 A$="12345678" : N=0
20 B$=""
30 CLS: PRINT "Entrez votre mot de passe :";
40 FOR I=1 TO 8
50 LOCATE I-1,1 : B$=B$+INPUT$(1) : PRINT "*" ;
60 NEXT I
70 IF B$ = A$ THEN CLS : PRINT "HELLO WORLD!":END
80 N=N+1
90 IF N=3 THEN CLS : BEEP0 : PRINT "Accès au programme refusé!" : END
100 CLS : BEEP0 : PRINT "Incorrect! Veuillez réessayer!"
110 GOTO 20
Peut-on optimiser ce code ?